Documentation
¶
Index ¶
Constants ¶
const ( RequestTypeExecute string = "execute" // an alternative name for "procedure" so that all the request-types can be a verb. RequestTypeProcedure string = "procedure" RequestTypeQuery string = "query" RequestTypeSubscribe string = "subscribe" )
Variables ¶
This section is empty.
Functions ¶
func AuthorizedExecute ¶
func Execute ¶
Execute makes an 'execute' XRPC request to the provided URL (passed in 'url'), putting the results into 'dst'.
NOTE that the official Bluesky docs call the 'execute' XRPC request-type 'procedure'. ('execute' was chosen here as it is a verb.)
You can provide Execute with an `https`, `http`, `xrpc`, or `xrpc-unencrypted` URL.
Here is an example usage of calling Execute with an `xrpc` URL:
var response map[string]any = map[string]any{}
src := struct{
Identifier string `json:"identifier"`
Password string `json:"password"`
}{
Identifier: "joeblow.bsky.social",
Password: "password123",
}
url := "xrpc://bsky.social/com.atproto.server.createSession"
err := xrpc.Execute(&response, url, src)
Here is an example usage of calling Execute with an `https` URL:
var response map[string]any = map[string]any{}
src := struct{
Identifier string `json:"identifier"`
Password string `json:"password"`
}{
Identifier: "joeblow.bsky.social",
Password: "password123",
}
url := "https://bsky.social/xrpc/com.atproto.server.createSession"
err := xrpc.Execute(&response, url, src)
func Query ¶
Query makes a 'query' XRPC request to the provided URL (passed in 'url'), putting the results into 'dst'.
You can provide Query with an `https`, `http`, `xrpc`, or `xrpc-unencrypted` URL.
Here is an example usage of calling Query with an `xrpc` URL:
var response map[string]any = map[string]any{}
url := "xrpc://public.api.bsky.app/app.bsky.actor.getProfile?actor=reiver.bsky.social"
err := xrpc.Query(&response, url)
Here is an example usage of calling Query with an `https` URL:
var response map[string]any = map[string]any{}
url := "https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=reiver.bsky.social"
err := xrpc.Query(&response, url)
func SetUserAgent ¶
func SetUserAgent(value string)
SetUserAgent sets the User-Agent in XRPC requests.
Types ¶
type Iterator ¶
Iterator represents an iterator.