Help us shape the future of Go! Take the 2026 Go Developer Survey

attachment

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 13 Imported by: 0

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

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 UploadAttachmentForIssue

func UploadAttachmentForIssue(ctx context.Context, file *UploaderFile, attach *repo_model.Attachment) (*repo_model.Attachment, error)

func UploadAttachmentForRelease

func UploadAttachmentForRelease(ctx context.Context, file *UploaderFile, attach *repo_model.Attachment) (*repo_model.Attachment, error)

Types

type UploadAttachmentFunc

type UploadAttachmentFunc func(ctx context.Context, file *UploaderFile, attach *repo_model.Attachment) (*repo_model.Attachment, error)

type UploaderFile

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

func NewLimitedUploaderKnownSize

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

func NewLimitedUploaderMaxBytesReader

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