common

package
v0.20.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

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 New

func New(state *state.State, stream *stream.Processor) *Processor

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.

func (*Processor) OnFilterChanged

func (p *Processor) OnFilterChanged(ctx context.Context, requester *gtsmodel.Account)

OnFilterChanged ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL