Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a "middleware" that tries to load an ActivityPub/ActivityStream document from the Interwebs.
If the server does not respond with an ActvityPub content-type then the request is forwarded to the inner client.
func (*Client) SetRootClient ¶
type ClientOption ¶
type ClientOption func(*Client)
func WithInnerClient ¶ added in v0.10.0
func WithInnerClient(innerClient streams.Client) ClientOption
WithInnerClient is an Option that sets the inner client for a Client. This allows the Client to forward requests to another client if it fails to load an ActivityPub document.
func WithKeyPairFunc ¶
func WithKeyPairFunc(fn KeyPairFunc) ClientOption
WithKeyPairFunc is an Option that sets the ActorGetter for a Client. This allows the Client to retrieve the public key ID and private key for a given URL only when needed, rather than performing expensive database queries ahead of time.
func WithUserAgent ¶
func WithUserAgent(userAgent string) ClientOption
WithUserAgent is an Option that sets the User-Agent header for a Client. Applications SHOULD set a custom User-Agent header that identifies the application and provides a URL for more information.
type KeyPairFunc ¶
type KeyPairFunc func() (publicKeyID string, privateKey crypto.PrivateKey)