Documentation ¶
Index ¶
- type Processor
- func (p *Processor) Create(ctx context.Context, account *gtsmodel.Account, ...) (*apimodel.Attachment, gtserror.WithCode)
- func (p *Processor) Delete(ctx context.Context, mediaAttachmentID string) gtserror.WithCode
- func (p *Processor) DeleteAvatar(ctx context.Context, account *gtsmodel.Account) (*apimodel.Account, gtserror.WithCode)
- func (p *Processor) DeleteHeader(ctx context.Context, account *gtsmodel.Account) (*apimodel.Account, gtserror.WithCode)
- func (p *Processor) Get(ctx context.Context, account *gtsmodel.Account, mediaAttachmentID string) (*apimodel.Attachment, gtserror.WithCode)
- func (p *Processor) GetCustomEmojis(ctx context.Context) ([]*apimodel.Emoji, gtserror.WithCode)
- func (p *Processor) GetFile(ctx context.Context, requester *gtsmodel.Account, ...) (*apimodel.Content, gtserror.WithCode)
- func (p *Processor) Unattach(ctx context.Context, account *gtsmodel.Account, mediaAttachmentID string) (*apimodel.Attachment, gtserror.WithCode)
- func (p *Processor) Update(ctx context.Context, account *gtsmodel.Account, mediaAttachmentID string, ...) (*apimodel.Attachment, gtserror.WithCode)
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 ¶
func (p *Processor) Create(ctx context.Context, account *gtsmodel.Account, form *apimodel.AttachmentRequest) (*apimodel.Attachment, gtserror.WithCode)
Create creates a new media attachment belonging to the given account, using the request form.
func (*Processor) Delete ¶
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) GetCustomEmojis ¶ added in v0.3.4
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, requester *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.