Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reiver/go-atproto
An implementation of BlueSky's AT-Protocol, for the Go programming language.
https://github.com/reiver/go-atproto
at-protocol atproto bluesky
Last synced: 3 months ago
JSON representation
An implementation of BlueSky's AT-Protocol, for the Go programming language.
- Host: GitHub
- URL: https://github.com/reiver/go-atproto
- Owner: reiver
- License: mit
- Created: 2023-05-01T15:29:32.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-09T14:12:46.000Z (5 months ago)
- Last Synced: 2024-11-11T09:06:05.578Z (3 months ago)
- Topics: at-protocol, atproto, bluesky
- Language: Go
- Homepage:
- Size: 50.8 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-atproto
Package **atproto** provides an implementation of **BlueSky**'s **AT-Protocol**, for the Go programming language.
## Documention
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-atproto
[![GoDoc](https://godoc.org/github.com/reiver/go-atproto?status.svg)](https://godoc.org/github.com/reiver/go-atproto)
## Examples
Here is an example of how to create a new post on Bluesky —
```golang
import
"time""github.com/reiver/go-atproto/com/atproto/repo"
"github.com/reiver/go-atproto/com/atproto/server"
)// ...
var handle string = "joeblow.bsky.social" // <--- REPLACE THIS WITH THE 'HANDLE' OF THE USER.
var password string = "password123" // <--- REPLACE THIS WITH THE 'PASSWORD' OF THE USER.// Login
var bearerToken string
{
var dst server.CreateSessionResponseerr := server.CreateSession(&dst, identifier, password)
if nil != err {
return return
}bearerToken = dst.AccessJWT
}// Post
var post map[string]any
{
when := time.Now().Format("2006-01-02T15:04:05.999Z")post = map[string]any{
"$type":"app.bsky.feed.post",
"text": "Test post at "+when,
"createdAt": when,
}
}var dst repo.CreateRecordResponse
{
var repoName string = handle
var collection string = "app.bsky.feed.post"err := repo.CreateRecord(&dst, bearerToken, repoName, collection, post)
if nil != err {
return err
}
}
```## Import
To import package **atproto** use `import` code like the follownig:
```
import "github.com/reiver/go-atproto"
```## Installation
To install package **atproto** do the following:
```
GOPROXY=direct go get https://github.com/reiver/go-atproto
```## Author
Package **atproto** was written by [Charles Iliya Krempeaux](http://reiver.link)