Documentation ¶
Index ¶
- type Processor
- func (p *Processor) EmojiGet(ctx context.Context, requestedEmojiID string) (interface{}, gtserror.WithCode)
- func (p *Processor) FeaturedCollectionGet(ctx context.Context, requestedUsername string) (interface{}, gtserror.WithCode)
- func (p *Processor) FollowersGet(ctx context.Context, requestedUsername string) (interface{}, gtserror.WithCode)
- func (p *Processor) FollowingGet(ctx context.Context, requestedUsername string) (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, requestedUsername string, page bool, maxID string, ...) (interface{}, gtserror.WithCode)
- func (p *Processor) StatusGet(ctx context.Context, requestedUsername string, requestedStatusID string) (interface{}, gtserror.WithCode)
- func (p *Processor) StatusRepliesGet(ctx context.Context, requestedUsername string, requestedStatusID string, ...) (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, tc typeutils.TypeConverter, federator federation.Federator, filter *visibility.Filter) Processor
New returns a new fedi processor.
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, requestedUsername 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, requestedUsername string) (interface{}, gtserror.WithCode)
FollowersGet handles the getting of a fedi/activitypub representation of a user/account's followers, performing appropriate authentication before returning a JSON serializable interface to the caller.
func (*Processor) FollowingGet ¶
func (p *Processor) FollowingGet(ctx context.Context, requestedUsername string) (interface{}, gtserror.WithCode)
FollowingGet handles the getting of a fedi/activitypub representation of a user/account's following, performing appropriate authentication before returning a JSON serializable interface to the caller.
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, requestedUsername string, page bool, maxID string, minID string) (interface{}, gtserror.WithCode)
OutboxGet returns the activitypub representation of a local user's outbox. This contains links to PUBLIC posts made by this user.
func (*Processor) StatusGet ¶
func (p *Processor) StatusGet(ctx context.Context, requestedUsername string, requestedStatusID 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, requestedUsername string, requestedStatusID string, page bool, onlyOtherAccounts bool, onlyOtherAccountsSet bool, minID string) (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.