v2

package
v0.16.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

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, converter *typeutils.Converter, stream *stream.Processor) Processor

func (*Processor) Create

Create a new filter for the given account, using the provided parameters. These params should have already been validated by the time they reach this function.

func (*Processor) Delete

func (p *Processor) Delete(
	ctx context.Context,
	account *gtsmodel.Account,
	filterID string,
) gtserror.WithCode

Delete an existing filter and all its attached keywords and statuses for the given account.

func (*Processor) Get

func (p *Processor) Get(ctx context.Context, account *gtsmodel.Account, filterID string) (*apimodel.FilterV2, gtserror.WithCode)

Get looks up a filter by ID and returns it with keywords and statuses.

func (*Processor) GetAll

func (p *Processor) GetAll(ctx context.Context, account *gtsmodel.Account) ([]*apimodel.FilterV2, gtserror.WithCode)

GetAll looks up all filters for the current account and returns them with keywords and statuses.

func (*Processor) KeywordCreate

KeywordCreate adds a filter keyword to an existing filter for the given account, using the provided parameters. These params should have already been normalized and validated by the time they reach this function.

func (*Processor) KeywordDelete

func (p *Processor) KeywordDelete(
	ctx context.Context,
	account *gtsmodel.Account,
	filterID string,
) gtserror.WithCode

KeywordDelete deletes an existing filter keyword from a filter.

func (*Processor) KeywordGet

func (p *Processor) KeywordGet(ctx context.Context, account *gtsmodel.Account, filterKeywordID string) (*apimodel.FilterKeyword, gtserror.WithCode)

KeywordGet looks up a filter keyword by ID.

func (*Processor) KeywordUpdate

func (p *Processor) KeywordUpdate(
	ctx context.Context,
	account *gtsmodel.Account,
	filterKeywordID string,
	form *apimodel.FilterKeywordCreateUpdateRequest,
) (*apimodel.FilterKeyword, gtserror.WithCode)

KeywordUpdate updates an existing filter keyword for the given account, using the provided parameters. These params should have already been validated by the time they reach this function.

func (*Processor) KeywordsGetForFilterID

func (p *Processor) KeywordsGetForFilterID(ctx context.Context, account *gtsmodel.Account, filterID string) ([]*apimodel.FilterKeyword, gtserror.WithCode)

KeywordsGetForFilterID looks up all filter keywords for the given filter.

func (*Processor) StatusCreate

StatusCreate adds a filter status to an existing filter for the given account, using the provided parameters. These params should have already been validated by the time they reach this function.

func (*Processor) StatusDelete

func (p *Processor) StatusDelete(
	ctx context.Context,
	account *gtsmodel.Account,
	filterID string,
) gtserror.WithCode

StatusDelete deletes an existing filter status from a filter.

func (*Processor) StatusGet

func (p *Processor) StatusGet(ctx context.Context, account *gtsmodel.Account, filterStatusID string) (*apimodel.FilterStatus, gtserror.WithCode)

StatusGet looks up a filter status by ID.

func (*Processor) StatusesGetForFilterID

func (p *Processor) StatusesGetForFilterID(ctx context.Context, account *gtsmodel.Account, filterID string) ([]*apimodel.FilterStatus, gtserror.WithCode)

StatusesGetForFilterID looks up all filter statuses for the given filter.

func (*Processor) Update

Update an existing filter for the given account, using the provided parameters. These params should have already been validated by the time they reach this function.

Jump to

Keyboard shortcuts

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