Documentation ¶
Index ¶
- func GetParseMentionFunc(dbConn db.DB, federator federation.Federator) gtsmodel.ParseMentionFunc
- func StatusFilterFunction(database db.DB, filter *visibility.Filter) timeline.FilterFunction
- func StatusGrabFunction(database db.DB) timeline.GrabFunction
- func StatusPrepareFunction(database db.DB, tc typeutils.TypeConverter) timeline.PrepareFunction
- func StatusSkipInsertFunction() timeline.SkipInsertFunction
- type Processor
- func (p *Processor) Account() *account.Processor
- func (p *Processor) Admin() *admin.Processor
- func (p *Processor) AppCreate(ctx context.Context, authed *oauth.Auth, ...) (*apimodel.Application, gtserror.WithCode)
- func (p *Processor) BlocksGet(ctx context.Context, authed *oauth.Auth, maxID string, sinceID string, ...) (*apimodel.BlocksResponse, gtserror.WithCode)
- func (p *Processor) EnqueueClientAPI(ctx context.Context, msgs ...messages.FromClientAPI)
- func (p *Processor) EnqueueFederator(ctx context.Context, msgs ...messages.FromFederator)
- func (p *Processor) FavedTimelineGet(ctx context.Context, authed *oauth.Auth, maxID string, minID string, limit int) (*apimodel.PageableResponse, gtserror.WithCode)
- func (p *Processor) Fedi() *fedi.Processor
- func (p *Processor) FollowRequestAccept(ctx context.Context, auth *oauth.Auth, accountID string) (*apimodel.Relationship, gtserror.WithCode)
- func (p *Processor) FollowRequestReject(ctx context.Context, auth *oauth.Auth, accountID string) (*apimodel.Relationship, gtserror.WithCode)
- func (p *Processor) FollowRequestsGet(ctx context.Context, auth *oauth.Auth) ([]apimodel.Account, gtserror.WithCode)
- func (p *Processor) HomeTimelineGet(ctx context.Context, authed *oauth.Auth, maxID string, sinceID string, ...) (*apimodel.PageableResponse, gtserror.WithCode)
- func (p *Processor) InstanceGetV1(ctx context.Context) (*apimodel.InstanceV1, gtserror.WithCode)
- func (p *Processor) InstanceGetV2(ctx context.Context) (*apimodel.InstanceV2, gtserror.WithCode)
- func (p *Processor) InstancePatch(ctx context.Context, form *apimodel.InstanceSettingsUpdateRequest) (*apimodel.InstanceV1, gtserror.WithCode)
- func (p *Processor) InstancePeersGet(ctx context.Context, includeSuspended bool, includeOpen bool, flat bool) (interface{}, gtserror.WithCode)
- func (p *Processor) Media() *media.Processor
- func (p *Processor) NotificationGet(ctx context.Context, account *gtsmodel.Account, targetNotifID string) (*apimodel.Notification, gtserror.WithCode)
- func (p *Processor) NotificationsClear(ctx context.Context, authed *oauth.Auth) gtserror.WithCode
- func (p *Processor) NotificationsGet(ctx context.Context, authed *oauth.Auth, maxID string, sinceID string, ...) (*apimodel.PageableResponse, gtserror.WithCode)
- func (p *Processor) OAuthHandleAuthorizeRequest(w http.ResponseWriter, r *http.Request) gtserror.WithCode
- func (p *Processor) OAuthHandleTokenRequest(r *http.Request) (map[string]interface{}, gtserror.WithCode)
- func (p *Processor) OAuthValidateBearerToken(r *http.Request) (oauth2.TokenInfo, error)
- func (p *Processor) PreferencesGet(ctx context.Context, accountID string) (*apimodel.Preferences, gtserror.WithCode)
- func (p *Processor) ProcessFromClientAPI(ctx context.Context, clientMsg messages.FromClientAPI) error
- func (p *Processor) ProcessFromFederator(ctx context.Context, federatorMsg messages.FromFederator) error
- func (p *Processor) PublicTimelineGet(ctx context.Context, authed *oauth.Auth, maxID string, sinceID string, ...) (*apimodel.PageableResponse, gtserror.WithCode)
- func (p *Processor) Report() *report.Processor
- func (p *Processor) SearchGet(ctx context.Context, authed *oauth.Auth, search *apimodel.SearchQuery) (*apimodel.SearchResult, gtserror.WithCode)
- func (p *Processor) Start() error
- func (p *Processor) Status() *status.Processor
- func (p *Processor) Stop() error
- func (p *Processor) Stream() *stream.Processor
- func (p *Processor) User() *user.Processor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetParseMentionFunc ¶ added in v0.2.2
func GetParseMentionFunc(dbConn db.DB, federator federation.Federator) gtsmodel.ParseMentionFunc
func StatusFilterFunction ¶ added in v0.2.0
func StatusFilterFunction(database db.DB, filter *visibility.Filter) timeline.FilterFunction
StatusFilterFunction returns a function that satisfies the FilterFunction interface in internal/timeline.
func StatusGrabFunction ¶ added in v0.2.0
func StatusGrabFunction(database db.DB) timeline.GrabFunction
StatusGrabFunction returns a function that satisfies the GrabFunction interface in internal/timeline.
func StatusPrepareFunction ¶ added in v0.2.0
func StatusPrepareFunction(database db.DB, tc typeutils.TypeConverter) timeline.PrepareFunction
StatusPrepareFunction returns a function that satisfies the PrepareFunction interface in internal/timeline.
func StatusSkipInsertFunction ¶ added in v0.2.0
func StatusSkipInsertFunction() timeline.SkipInsertFunction
StatusSkipInsertFunction returns a function that satisifes the SkipInsertFunction interface in internal/timeline.
Types ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func NewProcessor ¶
func NewProcessor( tc typeutils.TypeConverter, federator federation.Federator, oauthServer oauth.Server, mediaManager mm.Manager, state *state.State, emailSender email.Sender, ) *Processor
NewProcessor returns a new Processor.
func (*Processor) EnqueueClientAPI ¶ added in v0.8.0
func (p *Processor) EnqueueClientAPI(ctx context.Context, msgs ...messages.FromClientAPI)
func (*Processor) EnqueueFederator ¶ added in v0.8.0
func (p *Processor) EnqueueFederator(ctx context.Context, msgs ...messages.FromFederator)
func (*Processor) FavedTimelineGet ¶
func (*Processor) FollowRequestAccept ¶
func (*Processor) FollowRequestReject ¶
func (*Processor) FollowRequestsGet ¶
func (*Processor) HomeTimelineGet ¶
func (*Processor) InstanceGetV1 ¶ added in v0.7.0
func (*Processor) InstanceGetV2 ¶ added in v0.7.0
func (*Processor) InstancePatch ¶
func (p *Processor) InstancePatch(ctx context.Context, form *apimodel.InstanceSettingsUpdateRequest) (*apimodel.InstanceV1, gtserror.WithCode)
func (*Processor) InstancePeersGet ¶ added in v0.3.7
func (*Processor) NotificationGet ¶ added in v0.9.0
func (*Processor) NotificationsClear ¶ added in v0.4.0
func (*Processor) NotificationsGet ¶
func (*Processor) OAuthHandleAuthorizeRequest ¶ added in v0.3.5
func (*Processor) OAuthHandleTokenRequest ¶ added in v0.3.5
func (*Processor) OAuthValidateBearerToken ¶ added in v0.7.0
func (*Processor) PreferencesGet ¶ added in v0.9.0
func (*Processor) ProcessFromClientAPI ¶
func (*Processor) ProcessFromFederator ¶
func (p *Processor) ProcessFromFederator(ctx context.Context, federatorMsg messages.FromFederator) error
ProcessFromFederator reads the APActivityType and APObjectType of an incoming message from the federator, and directs the message into the appropriate side effect handler function, or simply does nothing if there's no handler function defined for the combination of Activity and Object.
func (*Processor) PublicTimelineGet ¶
func (*Processor) SearchGet ¶
func (p *Processor) SearchGet(ctx context.Context, authed *oauth.Auth, search *apimodel.SearchQuery) (*apimodel.SearchResult, gtserror.WithCode)
Implementation note: in this function, we tend to log errors at debug level rather than return them. This is because the search has a sort of fallthrough logic: if we can't get a result with x search, we should try with y search rather than returning.
If we get to the end and still haven't found anything, even then we shouldn't return an error, just return an empty search result.
The only exception to this is when we get a malformed query, in which case we return a bad request error so the user knows they did something funky.