Documentation ¶
Index ¶
- type Processor
- func (p *Processor) AcceptGet(ctx context.Context, requestedUser string, reqID string) (interface{}, gtserror.WithCode)
- func (p *Processor) EmojiGet(ctx context.Context, requestedEmojiID string) (interface{}, gtserror.WithCode)
- func (p *Processor) FeaturedCollectionGet(ctx context.Context, requestedUser string) (interface{}, gtserror.WithCode)
- func (p *Processor) FollowersGet(ctx context.Context, requestedUser string, page *paging.Page) (interface{}, gtserror.WithCode)
- func (p *Processor) FollowingGet(ctx context.Context, requestedUser string, page *paging.Page) (interface{}, gtserror.WithCode)
- func (p *Processor) HostMetaGet() *apimodel.HostMeta
- func (p *Processor) InboxPost(ctx context.Context, w http.ResponseWriter, r *http.Request) (bool, error)
- func (p *Processor) NodeInfoGet(ctx context.Context) (*apimodel.Nodeinfo, gtserror.WithCode)
- func (p *Processor) NodeInfoRelGet(ctx context.Context) (*apimodel.WellKnownResponse, gtserror.WithCode)
- func (p *Processor) OutboxGet(ctx context.Context, requestedUser string, page *paging.Page) (interface{}, gtserror.WithCode)
- func (p *Processor) StatusGet(ctx context.Context, requestedUser string, statusID string) (interface{}, gtserror.WithCode)
- func (p *Processor) StatusRepliesGet(ctx context.Context, requestedUser string, statusID string, page *paging.Page, ...) (interface{}, gtserror.WithCode)
- func (p *Processor) UserGet(ctx context.Context, requestedUsername string, requestURL *url.URL) (interface{}, gtserror.WithCode)
- func (p *Processor) WebfingerGet(ctx context.Context, requestedUsername string) (*apimodel.WellKnownResponse, gtserror.WithCode)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func New ¶
func New( state *state.State, common *common.Processor, converter *typeutils.Converter, federator *federation.Federator, visFilter *visibility.Filter, ) Processor
New returns a new fedi processor.
func (*Processor) AcceptGet ¶ added in v0.17.0
func (p *Processor) AcceptGet( ctx context.Context, requestedUser string, reqID string, ) (interface{}, gtserror.WithCode)
AcceptGet handles the getting of a fedi/activitypub representation of a local interaction acceptance.
It performs appropriate authentication before returning a JSON serializable interface.
func (*Processor) EmojiGet ¶
func (p *Processor) EmojiGet(ctx context.Context, requestedEmojiID string) (interface{}, gtserror.WithCode)
EmojiGet handles the GET for a federated emoji originating from this instance.
func (*Processor) FeaturedCollectionGet ¶
func (p *Processor) FeaturedCollectionGet(ctx context.Context, requestedUser string) (interface{}, gtserror.WithCode)
FeaturedCollectionGet returns an ordered collection of the requested username's Pinned posts. The returned collection have an `items` property which contains an ordered list of status URIs.
func (*Processor) FollowersGet ¶
func (p *Processor) FollowersGet( ctx context.Context, requestedUser string, page *paging.Page, ) (interface{}, gtserror.WithCode)
FollowersGet returns the serialized ActivityPub collection of a local account's followers collection, which contains links to accounts following this account.
func (*Processor) FollowingGet ¶
func (p *Processor) FollowingGet(ctx context.Context, requestedUser string, page *paging.Page) (interface{}, gtserror.WithCode)
FollowingGet returns the serialized ActivityPub collection of a local account's following collection, which contains links to accounts followed by this account.
func (*Processor) HostMetaGet ¶
HostMetaGet returns a host-meta struct in response to a host-meta request.
func (*Processor) InboxPost ¶
func (p *Processor) InboxPost(ctx context.Context, w http.ResponseWriter, r *http.Request) (bool, error)
InboxPost handles POST requests to a user's inbox for new activitypub messages.
InboxPost returns true if the request was handled as an ActivityPub POST to an actor's inbox. If false, the request was not an ActivityPub request and may still be handled by the caller in another way, such as serving a web page.
If the error is nil, then the ResponseWriter's headers and response has already been written. If a non-nil error is returned, then no response has been written.
If the Actor was constructed with the Federated Protocol enabled, side effects will occur.
If the Federated Protocol is not enabled, writes the http.StatusMethodNotAllowed status code in the response. No side effects occur.
func (*Processor) NodeInfoGet ¶
NodeInfoGet returns a node info struct in response to a node info request.
func (*Processor) NodeInfoRelGet ¶
func (p *Processor) NodeInfoRelGet(ctx context.Context) (*apimodel.WellKnownResponse, gtserror.WithCode)
NodeInfoRelGet returns a well known response giving the path to node info.
func (*Processor) OutboxGet ¶
func (p *Processor) OutboxGet( ctx context.Context, requestedUser string, page *paging.Page, ) (interface{}, gtserror.WithCode)
OutboxGet returns the serialized ActivityPub collection of a local account's outbox, which contains links to PUBLIC posts by this account.
func (*Processor) StatusGet ¶
func (p *Processor) StatusGet(ctx context.Context, requestedUser string, statusID string) (interface{}, gtserror.WithCode)
StatusGet handles the getting of a fedi/activitypub representation of a local status. It performs appropriate authentication before returning a JSON serializable interface.
func (*Processor) StatusRepliesGet ¶
func (p *Processor) StatusRepliesGet( ctx context.Context, requestedUser string, statusID string, page *paging.Page, onlyOtherAccounts bool, ) (interface{}, gtserror.WithCode)
GetStatus handles the getting of a fedi/activitypub representation of replies to a status, performing appropriate authentication before returning a JSON serializable interface to the caller.
func (*Processor) UserGet ¶
func (p *Processor) UserGet(ctx context.Context, requestedUsername string, requestURL *url.URL) (interface{}, gtserror.WithCode)
UserGet handles the getting of a fedi/activitypub representation of a user/account, performing authentication before returning a JSON serializable interface to the caller.
func (*Processor) WebfingerGet ¶
func (p *Processor) WebfingerGet(ctx context.Context, requestedUsername string) (*apimodel.WellKnownResponse, gtserror.WithCode)
WebfingerGet handles the GET for a webfinger resource. Most commonly, it will be used for returning account lookups.