Documentation ¶
Index ¶
- func NewAttachment(ctx context.Context, attach *repo_model.Attachment, file io.Reader, size int64) (*repo_model.Attachment, error)
- func UpdateAttachment(ctx context.Context, allowedTypes string, attach *repo_model.Attachment) error
- func UploadAttachment(ctx context.Context, file io.Reader, allowedTypes string, fileSize int64, ...) (*repo_model.Attachment, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAttachment ¶
func NewAttachment(ctx context.Context, attach *repo_model.Attachment, file io.Reader, size int64) (*repo_model.Attachment, error)
NewAttachment creates a new attachment object, but do not verify.
func UpdateAttachment ¶ added in v1.23.0
func UpdateAttachment(ctx context.Context, allowedTypes string, attach *repo_model.Attachment) error
UpdateAttachment updates an attachment, verifying that its name is among the allowed types.
func UploadAttachment ¶
func UploadAttachment(ctx context.Context, file io.Reader, allowedTypes string, fileSize int64, attach *repo_model.Attachment) (*repo_model.Attachment, error)
UploadAttachment upload new attachment into storage and update database
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.