Documentation
¶
Index ¶
- Constants
- Variables
- func ActivityActorTargetCollections(act vocab.Item, colFn iriGenFn) (vocab.IRIs, error)
- func HTTPClient(c httpClient) *http.Client
- func UserAgentTransport(ua string, wrap http.RoundTripper) http.RoundTripper
- type Basic
- type C
- func (c C) Activity(ctx context.Context, iri vocab.IRI) (*vocab.Activity, error)
- func (c C) Actor(ctx context.Context, iri vocab.IRI) (*vocab.Actor, error)
- func (c C) Collection(ctx context.Context, iri vocab.IRI, ff ...filters.Check) (vocab.CollectionInterface, error)
- func (c C) CtxGet(ctx context.Context, url string) (*http.Response, error)
- func (c C) CtxLoadIRI(ctx context.Context, id vocab.IRI) (vocab.Item, error)
- func (c C) CtxToCollection(ctx context.Context, a vocab.Item, url ...vocab.IRI) (vocab.IRI, vocab.Item, error)
- func (c *C) Do(req *http.Request) (*http.Response, error)
- func (c C) Followers(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
- func (c C) Following(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
- func (c C) Inbox(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
- func (c C) Liked(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
- func (c C) Likes(ctx context.Context, object vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
- func (c C) LoadIRI(id vocab.IRI) (vocab.Item, error)
- func (c C) Object(ctx context.Context, iri vocab.IRI) (*vocab.Object, error)
- func (c C) Outbox(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
- func (c C) Replies(ctx context.Context, object vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
- func (c C) Shares(ctx context.Context, object vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
- func (c C) ToCollection(a vocab.Item, url ...vocab.IRI) (vocab.IRI, vocab.Item, error)
- func (c C) ToInbox(ctx context.Context, act vocab.Item) (vocab.IRI, vocab.Item, error)
- func (c C) ToOutbox(ctx context.Context, act vocab.Item) (vocab.IRI, vocab.Item, error)
- type Ctx
- type CtxLogFn
- type LogFn
- type OptionFn
- type PubClient
- type PubGetter
- type PubSubmitter
- type RequestSignFn
Constants ¶
const ( ContentTypeJsonLD = `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` // ContentTypeActivityJson This specification registers the application/activity+json MIME Media Type // specifically for identifying documents conforming to the Activity Streams 2.0 format. // // https://www.w3.org/TR/activitystreams-core/#media-type ContentTypeActivityJson = `application/activity+json` )
const MB = 1024 * 1024 * 1024
Variables ¶
var UserAgent = "GoActivityPub DefaultClient (https://github.com/go-ap)"
UserAgent value that the client uses when performing requests
Functions ¶
func HTTPClient ¶
func UserAgentTransport ¶
func UserAgentTransport(ua string, wrap http.RoundTripper) http.RoundTripper
Types ¶
type C ¶
type C struct {
// contains filtered or unexported fields
}
func (C) Collection ¶
func (c C) Collection(ctx context.Context, iri vocab.IRI, ff ...filters.Check) (vocab.CollectionInterface, error)
Collection fetches the iri vocab.IRI as a collection. It applies filters to the received object.
func (C) CtxLoadIRI ¶
CtxLoadIRI tries to dereference an IRI and load the full ActivityPub object it represents
func (C) CtxToCollection ¶
func (c C) CtxToCollection(ctx context.Context, a vocab.Item, url ...vocab.IRI) (vocab.IRI, vocab.Item, error)
CtxToCollection
func (C) Followers ¶
func (c C) Followers(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Followers fetches the followers collection of the actor Item. It applies filters to the received collection object.
func (C) Following ¶
func (c C) Following(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Following fetches the following collection of the actor Item. It applies filters to the received collection object.
func (C) Inbox ¶
func (c C) Inbox(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Inbox fetches the inbox collection of the actor Item. It applies filters to the received collection object.
func (C) Liked ¶
func (c C) Liked(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Liked fetches the liked collection of the actor Item. It applies filters to the received collection object.
func (C) Likes ¶
func (c C) Likes(ctx context.Context, object vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Likes fetches the likes collection of the object Item. It applies filters to the received collection object.
func (C) LoadIRI ¶
LoadIRI tries to dereference an IRI and load the full ActivityPub object it represents
func (C) Outbox ¶
func (c C) Outbox(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Outbox fetches the outbox collection of the actor Item. It applies filters to the received collection object.
func (C) Replies ¶
func (c C) Replies(ctx context.Context, object vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Replies fetches the replies collection of the object Item. It applies filters to the received collection object.
func (C) Shares ¶
func (c C) Shares(ctx context.Context, object vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Shares fetches the shares collection of the object Item. It applies filters to the received collection object.
func (C) ToCollection ¶
ToCollection
type OptionFn ¶
OptionFn
func SkipTLSValidation ¶
SkipTLSValidation sets the flag for skipping TLS validation on the default HTTP transport.
func WithHTTPClient ¶
WithHTTPClient sets the http client
func WithLogger ¶
type PubClient ¶
type PubClient interface {
PubGetter
PubSubmitter
}
type PubGetter ¶
type PubGetter interface {
Inbox(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Outbox(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Following(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Followers(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Likes(ctx context.Context, object vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Liked(ctx context.Context, actor vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Replies(ctx context.Context, object vocab.Item, ff ...filters.Check) (vocab.CollectionInterface, error)
Collection(ctx context.Context, i vocab.IRI, ff ...filters.Check) (vocab.CollectionInterface, error)
Actor(ctx context.Context, iri vocab.IRI) (*vocab.Actor, error)
Activity(ctx context.Context, iri vocab.IRI) (*vocab.Activity, error)
Object(ctx context.Context, iri vocab.IRI) (*vocab.Object, error)
}