media

package
v0.17.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: AGPL-3.0 Imports: 25 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(
	common *common.Processor,
	state *state.State,
	converter *typeutils.Converter,
	federator *federation.Federator,
	mediaManager *media.Manager,
	transportController transport.Controller,
) Processor

New returns a new media processor.

func (*Processor) Create

Create creates a new media attachment belonging to the given account, using the request form.

func (*Processor) Delete

func (p *Processor) Delete(ctx context.Context, mediaAttachmentID string) gtserror.WithCode

Delete deletes the media attachment with the given ID, including all files pertaining to that attachment.

func (*Processor) DeleteAvatar added in v0.16.0

func (p *Processor) DeleteAvatar(
	ctx context.Context,
	account *gtsmodel.Account,
) (*apimodel.Account, gtserror.WithCode)

DeleteAvatar deletes the account's avatar, if one exists, and returns the updated account. If no avatar exists, it returns anyway with no error.

func (*Processor) DeleteHeader added in v0.16.0

func (p *Processor) DeleteHeader(
	ctx context.Context,
	account *gtsmodel.Account,
) (*apimodel.Account, gtserror.WithCode)

DeleteHeader deletes the account's header, if one exists, and returns the updated account. If no header exists, it returns anyway with no error.

func (*Processor) Get added in v0.8.0

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

func (*Processor) GetCustomEmojis added in v0.3.4

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

GetCustomEmojis returns a list of all useable local custom emojis stored on this instance. 'useable' in this context means visible and picker, and not disabled.

func (*Processor) GetFile

GetFile retrieves a file from storage and streams it back to the caller via an io.reader embedded in *apimodel.Content.

func (*Processor) Unattach added in v0.3.7

func (p *Processor) Unattach(ctx context.Context, account *gtsmodel.Account, mediaAttachmentID string) (*apimodel.Attachment, gtserror.WithCode)

Unattach unattaches the media attachment with the given ID from any statuses it was attached to, making it available for reattachment again.

func (*Processor) Update

func (p *Processor) Update(ctx context.Context, account *gtsmodel.Account, mediaAttachmentID string, form *apimodel.AttachmentUpdateRequest) (*apimodel.Attachment, gtserror.WithCode)

Update updates a media attachment with the given id, using the provided form parameters.

Jump to

Keyboard shortcuts

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