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

upload

package
v1.27.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUploadContext

func AddUploadContext(ctx *context.Context, uploadType string)

AddUploadContext renders template values for dropzone

func AddUploadContextForRepo

func AddUploadContextForRepo(ctx reqctx.RequestContext, repo *repo_model.Repository)

func IsErrFileTypeForbidden

func IsErrFileTypeForbidden(err error) bool

IsErrFileTypeForbidden checks if an error is a ErrFileTypeForbidden.

func Verify

func Verify(buf []byte, fileName, allowedTypesStr string) error

Verify validates whether a file is allowed to be uploaded. If buf is empty, it will just check if the file has an allowed file extension.

Types

type ErrFileTypeForbidden

type ErrFileTypeForbidden struct {
	Type string
}

ErrFileTypeForbidden not allowed file type error

func (ErrFileTypeForbidden) Error

func (err ErrFileTypeForbidden) Error() string

Jump to

Keyboard shortcuts

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