file

package
v0.0.0-...-b667aad Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Downloader

type Downloader struct {
	Dir string
}

func (*Downloader) Handle

func (d *Downloader) Handle() handler.Handle

type StaticResourceHandler

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

func NewStaticResourceHandler

func NewStaticResourceHandler(dir string, pathPrefix string,
	options ...StaticResourceHandlerOption) *StaticResourceHandler

func (*StaticResourceHandler) Handler

func (s *StaticResourceHandler) Handler(ctx *context.Context)

type StaticResourceHandlerOption

type StaticResourceHandlerOption func(handler *StaticResourceHandler)

func WithFileCache

func WithFileCache(maxFileSizeThreshold int, maxCacheFileCnt int) StaticResourceHandlerOption

func WithMoreExtension

func WithMoreExtension(extMap map[string]string) StaticResourceHandlerOption

type Uploader

type Uploader struct {
	FileField string
	// 计算目标路径
	DstPathFunc func(fh *multipart.FileHeader) string
}

func (*Uploader) Handle

func (u *Uploader) Handle() handler.Handle

func (*Uploader) HandleFunc

func (u *Uploader) HandleFunc(ctx *context.Context)

Jump to

Keyboard shortcuts

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