Skip to content

Package xrpcuri provides an implementation of the XRPC-URI for BlueSky and its AT-Protocol, for the Go programming language.

License

Notifications You must be signed in to change notification settings

reiver/go-xrpcuri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-xrpcuri

Package xrpcuri provides an implementation of the XRPC-URI for BlueSky and its AT-Protocol, for the Go programming language.

XRPC is defined here: https://atproto.com/specs/xrpc

The XRPC-URI is not part of the https://atproto.com/specs/xrpc specification, but is instead something invented by this package.

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-xrpcuri

GoDoc

XRPC URI Resolution

This package introduces two URI schemes for XRPC:

  • xrpc, and
  • xrpc-unencrypted.

For example:

  • xrpc://public.api.bsky.app/app.bsky.actor.getProfile?actor=reiver.bsky.social
  • xrpc-unencrypted://localhost/app.bsky.actor.getProfile?actor=reiver.bsky.social

Behind-the-scenes the scenes, these XRPC URI schemes are resolved to HTTPS, HTTP, WSS, and WS URLs.

MOST DEVELOPERS WHO ARE JUST MAKING XRPC CLIENT REQUESTS DO NOT HAVE TO WORRY ABOUT THE DETAILS OF THE RESOLUTION. IN THE SAME WAY THAT MOST DEVELOPERS DO NOT HAVE TO WORRY ABOUT HOW HTTP URIS ARE RESOLVED TO TCP.

How an XRPC URI gets resolved to an HTTPS, HTTP, WSS, or WS URL, depends on the XRPC request type.

Here are some examples:

XRPC URI XRPC Request Type Resolved URL
xrpc://example.com/app.cherry.fooBar execute https://example.com/xrpc/app.cherry.fooBar
xrpc://example.com/app.cherry.fooBar query https://example.com/xrpc/app.cherry.fooBar
xrpc://example.com/app.cherry.fooBar subscribe wss://example.com/xrpc/app.cherry.fooBar
xrpc-unencrypted://localhost/link.banana.bazQux execute http://localhost/xrpc/link.banana.bazQux
xrpc-unencrypted://localhost/link.banana.bazQux query http://localhost/xrpc/link.banana.bazQux
xrpc-unencrypted://localhost/link.banana.bazQux subscribe ws://localhost/xrpc/link.banana.bazQux

Import

To import package xrpcuri use import code like the follownig:

import "github.com/reiver/go-xrpcuri"

Installation

To install package xrpcuri do the following:

GOPROXY=direct go get https://github.com/reiver/go-xrpcuri

Author

Package xrpcuri was written by Charles Iliya Krempeaux

See Also

About

Package xrpcuri provides an implementation of the XRPC-URI for BlueSky and its AT-Protocol, for the Go programming language.

Topics

Resources

License

Stars

Watchers

Forks

Languages