https://github.com/reiver/go-aturi
Package aturi provides tools for working with AT-URIs, for the Go programming language. AT-URIs are used by the Bluesky network and its AT-protocol.
https://github.com/reiver/go-aturi
at-protocol at-uri atproto bluesky
Last synced: about 1 month ago
JSON representation
Package aturi provides tools for working with AT-URIs, for the Go programming language. AT-URIs are used by the Bluesky network and its AT-protocol.
- Host: GitHub
- URL: https://github.com/reiver/go-aturi
- Owner: reiver
- License: mit
- Created: 2024-08-29T04:45:43.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-29T12:43:30.000Z (almost 2 years ago)
- Last Synced: 2025-01-17T16:37:30.834Z (over 1 year ago)
- Topics: at-protocol, at-uri, atproto, bluesky
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-aturi
Package **aturi** provides tools for working with AT-URIs, for the Go programming language.
AT-URIs are used by the Bluesky network and its AT-protocol, and are defined at:
https://atproto.com/specs/at-uri-scheme
## Documention
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-aturi
[](https://godoc.org/github.com/reiver/go-aturi)
## Examples
Here are some examples for using package **aturi**.
### Validation Example
You can validate an AT-URI with code similar to the following:
```golang
import "github.com/reiver/go-aturi"
// ...
var atURI string = "at://did:plc:scewmn2pl3oz36mxme2b6czz"
// ...
err := aturi.Validate(atURI)
```
### Split Example
You can split an AT-URI into its components with code similar to the following:
```golang
import "github.com/reiver/go-aturi"
// ...
var atURI string = "at://did:plc:scewmn2pl3oz36mxme2b6czz"
// ...
authority, collection, rkey, query, fragment, err := aturi.Split(atURI)
```
## Join Example
You can create a normalized AT-URI with code similar to the following:
```golang
import "github.com/reiver/go-aturi"
// ...
var authority string = "did:plc:scewmn2pl3oz36mxme2b6czz"
var collection string = "com.example.fooBar"
var rkey string = "wxyz1234"
var query string = ""
var fragment string = ""
var atURI string = aturi.Join(authority, collection, rkey, query, fragment)
```
## Import
To import package **aturi** use `import` code like the follownig:
```
import "github.com/reiver/go-aturi"
```
## Installation
To install package **aturi** do the following:
```
GOPROXY=direct go get https://github.com/reiver/go-aturi
```
## Author
Package **aturi** was written by [Charles Iliya Krempeaux](http://reiver.link)
## See Also
* https://github.com/reiver/go-athandle
* https://github.com/reiver/go-atproto
* https://github.com/reiver/go-aturi
* https://github.com/reiver/go-bsky
* https://github.com/reiver/go-did
* https://github.com/reiver/go-didplc
* https://github.com/reiver/go-nsid
* https://github.com/reiver/go-xrpc
* https://github.com/reiver/go-xrpcuri