admin

package
v0.11.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: AGPL-3.0 Imports: 30 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, tc typeutils.TypeConverter, mediaManager *media.Manager, transportController transport.Controller, emailSender email.Sender) Processor

New returns a new admin processor.

func (*Processor) AccountAction added in v0.2.2

func (*Processor) DomainBlockCreate

func (p *Processor) DomainBlockCreate(
	ctx context.Context,
	account *gtsmodel.Account,
	domain string,
	obfuscate bool,
	publicComment string,
	privateComment string,
	subscriptionID string,
) (*apimodel.DomainBlock, gtserror.WithCode)

DomainBlockCreate creates an instance-level block against the given domain, and then processes side effects of that block (deleting accounts, media, etc).

If a domain block already exists for the domain, side effects will be retried.

func (*Processor) DomainBlockDelete

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

DomainBlockDelete removes one domain block with the given ID, and processes side effects of removing the block asynchronously.

func (*Processor) DomainBlockGet

func (p *Processor) DomainBlockGet(ctx context.Context, id string, export bool) (*apimodel.DomainBlock, gtserror.WithCode)

DomainBlockGet returns one domain block with the given id. If export is true, the format will be suitable for writing out to an export.

func (*Processor) DomainBlocksGet

func (p *Processor) DomainBlocksGet(ctx context.Context, account *gtsmodel.Account, export bool) ([]*apimodel.DomainBlock, gtserror.WithCode)

DomainBlocksGet returns all existing domain blocks. If export is true, the format will be suitable for writing out to an export.

func (*Processor) DomainBlocksImport

func (p *Processor) DomainBlocksImport(
	ctx context.Context,
	account *gtsmodel.Account,
	domainsF *multipart.FileHeader,
) (*apimodel.MultiStatus, gtserror.WithCode)

DomainBlocksImport handles the import of multiple domain blocks, by calling the DomainBlockCreate function for each domain in the provided file. Will return a slice of processed domain blocks.

In the case of total failure, a gtserror.WithCode will be returned so that the caller can respond appropriately. In the case of partial or total success, a MultiStatus model will be returned, which contains information about success/failure count, so that the caller can retry any failures as they wish.

func (*Processor) EmailTest added in v0.8.0

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

EmailTest sends a generic test email to the given toAddress (which should be a valid email address). To help callers differentiate between proper errors and the smtp errors they're likely fishing for, will return 422 + help text on an SMTP error, or error 500 otherwise.

func (*Processor) EmojiCategoriesGet added in v0.6.0

func (p *Processor) EmojiCategoriesGet(ctx context.Context) ([]*apimodel.EmojiCategory, gtserror.WithCode)

EmojiCategoriesGet returns all custom emoji categories that exist on this instance.

func (*Processor) EmojiCreate

EmojiCreate creates a custom emoji on this instance.

func (*Processor) EmojiDelete added in v0.6.0

func (p *Processor) EmojiDelete(ctx context.Context, id string) (*apimodel.AdminEmoji, gtserror.WithCode)

EmojiDelete deletes one emoji from the database, with the given id.

func (*Processor) EmojiGet added in v0.6.0

func (p *Processor) EmojiGet(ctx context.Context, account *gtsmodel.Account, user *gtsmodel.User, id string) (*apimodel.AdminEmoji, gtserror.WithCode)

EmojiGet returns the admin view of one custom emoji with the given id.

func (*Processor) EmojiUpdate added in v0.6.0

EmojiUpdate updates one emoji with the given id, using the provided form parameters.

func (*Processor) EmojisGet added in v0.6.0

func (p *Processor) EmojisGet(
	ctx context.Context,
	account *gtsmodel.Account,
	user *gtsmodel.User,
	domain string,
	includeDisabled bool,
	includeEnabled bool,
	shortcode string,
	maxShortcodeDomain string,
	minShortcodeDomain string,
	limit int,
) (*apimodel.PageableResponse, gtserror.WithCode)

EmojisGet returns an admin view of custom emojis, filtered with the given parameters.

func (*Processor) MediaPrune added in v0.3.4

func (p *Processor) MediaPrune(ctx context.Context, mediaRemoteCacheDays int) gtserror.WithCode

MediaPrune triggers a non-blocking prune of unused media, orphaned, uncaching remote and fixing cache states.

func (*Processor) MediaRefetch added in v0.7.0

func (p *Processor) MediaRefetch(ctx context.Context, requestingAccount *gtsmodel.Account, domain string) gtserror.WithCode

MediaRefetch forces a refetch of remote emojis.

func (*Processor) ReportGet added in v0.7.0

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

ReportGet returns one report, with the given ID.

func (*Processor) ReportResolve added in v0.7.0

func (p *Processor) ReportResolve(ctx context.Context, account *gtsmodel.Account, id string, actionTakenComment *string) (*apimodel.AdminReport, gtserror.WithCode)

ReportResolve marks a report with the given id as resolved, and stores the provided actionTakenComment (if not null). If the report creator is from this instance, an email will be sent to them to let them know that the report is resolved.

func (*Processor) ReportsGet added in v0.7.0

func (p *Processor) ReportsGet(
	ctx context.Context,
	account *gtsmodel.Account,
	resolved *bool,
	accountID string,
	targetAccountID string,
	maxID string,
	sinceID string,
	minID string,
	limit int,
) (*apimodel.PageableResponse, gtserror.WithCode)

ReportsGet returns all reports stored on this instance, with the given parameters.

Jump to

Keyboard shortcuts

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