Documentation
¶
Index ¶
- func FromAPIContexts(apiContexts []apimodel.FilterContext) (gtsmodel.FilterContexts, gtserror.WithCode)
- type Processor
- func (p *Processor) CheckFilterExists(ctx context.Context, requester *gtsmodel.Account, id string) gtserror.WithCode
- func (p *Processor) GetFilter(ctx context.Context, requester *gtsmodel.Account, id string) (*gtsmodel.Filter, gtserror.WithCode)
- func (p *Processor) GetFilterKeyword(ctx context.Context, requester *gtsmodel.Account, id string) (*gtsmodel.FilterKeyword, *gtsmodel.Filter, gtserror.WithCode)
- func (p *Processor) GetFilterStatus(ctx context.Context, requester *gtsmodel.Account, id string) (*gtsmodel.FilterStatus, *gtsmodel.Filter, gtserror.WithCode)
- func (p *Processor) OnFilterChanged(ctx context.Context, requester *gtsmodel.Account)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromAPIContexts ¶
func FromAPIContexts(apiContexts []apimodel.FilterContext) (gtsmodel.FilterContexts, gtserror.WithCode)
FromAPIContexts converts a slice of frontend API model FilterContext types to our internal FilterContexts bit field.
Types ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func (*Processor) CheckFilterExists ¶
func (p *Processor) CheckFilterExists( ctx context.Context, requester *gtsmodel.Account, id string, ) gtserror.WithCode
CheckFilterExists calls .GetFilter() with a barebones context to not fetch any sub-models, and not returning the result. this functionally just uses .GetFilter() for the ownership and existence checks.
func (*Processor) GetFilter ¶
func (p *Processor) GetFilter( ctx context.Context, requester *gtsmodel.Account, id string, ) ( *gtsmodel.Filter, gtserror.WithCode, )
GetFilter fetches the filter with given ID, also checking the given requesting account is the owner of the filter.
func (*Processor) GetFilterKeyword ¶
func (p *Processor) GetFilterKeyword( ctx context.Context, requester *gtsmodel.Account, id string, ) ( *gtsmodel.FilterKeyword, *gtsmodel.Filter, gtserror.WithCode, )
GetFilterKeyword fetches the filter keyword with given ID, also checking the given requesting account is the owner of it.
func (*Processor) GetFilterStatus ¶
func (p *Processor) GetFilterStatus( ctx context.Context, requester *gtsmodel.Account, id string, ) ( *gtsmodel.FilterStatus, *gtsmodel.Filter, gtserror.WithCode, )
GetFilterStatus fetches the filter status with given ID, also checking the given requesting account is the owner of it.