attachment

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 13 Imported by: 3

Documentation

Index

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 UploadAttachmentGeneralSizeLimit added in v1.25.0

func UploadAttachmentGeneralSizeLimit(ctx context.Context, file *UploaderFile, allowedTypes string, attach *repo_model.Attachment) (*repo_model.Attachment, error)

Types

type UploaderFile added in v1.25.0

type UploaderFile struct {
	// contains filtered or unexported fields
}

func NewLimitedUploaderKnownSize added in v1.25.0

func NewLimitedUploaderKnownSize(r io.Reader, size int64) *UploaderFile

func NewLimitedUploaderMaxBytesReader added in v1.25.0

func NewLimitedUploaderMaxBytesReader(r io.ReadCloser, w http.ResponseWriter) *UploaderFile

Jump to

Keyboard shortcuts

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