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) 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, requestingAccount *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(state *state.State, converter *typeutils.Converter, 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) 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, 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.