media

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: AGPL-3.0 Imports: 22 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, 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) 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

func (p *Processor) GetFile(
	ctx context.Context,
	requestingAccount *gtsmodel.Account,
	form *apimodel.GetContentRequestForm,
) (*apimodel.Content, gtserror.WithCode)

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