list

package
v0.17.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: AGPL-3.0 Imports: 14 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) Processor

func (*Processor) AddToList

func (p *Processor) AddToList(ctx context.Context, account *gtsmodel.Account, listID string, targetAccountIDs []string) gtserror.WithCode

AddToList adds targetAccountIDs to the given list, if valid.

func (*Processor) Create

func (p *Processor) Create(
	ctx context.Context,
	account *gtsmodel.Account,
	title string,
	repliesPolicy gtsmodel.RepliesPolicy,
	exclusive bool,
) (*apimodel.List, gtserror.WithCode)

Create creates one a new list 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, id string) gtserror.WithCode

Delete deletes one list for the given account.

func (*Processor) Get

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

Get returns the api model of one list with the given ID.

func (*Processor) GetAll

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

GetAll returns multiple lists created by the given account, sorted by list ID DESC (newest first).

func (*Processor) GetListAccounts

func (p *Processor) GetListAccounts(
	ctx context.Context,
	account *gtsmodel.Account,
	listID string,
	page *paging.Page,
) (*apimodel.PageableResponse, gtserror.WithCode)

GetListAccounts returns accounts that are in the given list, owned by the given account. The additional parameters can be used for paging. Nil page param returns all accounts.

func (*Processor) RemoveFromList

func (p *Processor) RemoveFromList(
	ctx context.Context,
	account *gtsmodel.Account,
	listID string,
	targetAccountIDs []string,
) gtserror.WithCode

RemoveFromList removes targetAccountIDs from the given list, if valid.

func (*Processor) Update

func (p *Processor) Update(
	ctx context.Context,
	account *gtsmodel.Account,
	id string,
	title *string,
	repliesPolicy *gtsmodel.RepliesPolicy,
	exclusive *bool,
) (*apimodel.List, gtserror.WithCode)

Update updates one list 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