unmarshalers

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentDispositionOrFilenameEmpty = "Content-Disposition or filename is empty"
	UnsupportedFilenameStrategy       = "filename strategy is not supported"
	MustPassPtrOfFileInfo             = "parameter must be Ptr of FileInfo"
)
View Source
const (
	ZeroStr         = ""
	TempFilePattern = "gotten-*.tmp"
)

Variables

This section is empty.

Functions

func UnsupportedFilenameStrategyError added in v1.2.0

func UnsupportedFilenameStrategyError(strategy FilenameStrategy) error

Types

type FileCtr added in v1.2.0

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

func NewFileCtr added in v1.2.0

func NewFileCtr() (ctr *FileCtr, err error)

func (FileCtr) Unmarshal added in v1.2.0

func (ctr FileCtr) Unmarshal(reader io.ReadCloser, header http.Header, v interface{}) (err error)

type FileCtrBuilder added in v1.2.0

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

func (*FileCtrBuilder) Build added in v1.2.0

func (builder *FileCtrBuilder) Build() (ctr *FileCtr, err error)

func (*FileCtrBuilder) Discard added in v1.2.0

func (builder *FileCtrBuilder) Discard() *FileCtrBuilder

func (*FileCtrBuilder) SetBasePath added in v1.2.0

func (builder *FileCtrBuilder) SetBasePath(path string) *FileCtrBuilder

func (*FileCtrBuilder) SetExtName added in v1.2.0

func (builder *FileCtrBuilder) SetExtName(name string) *FileCtrBuilder

func (*FileCtrBuilder) SetStrategy added in v1.2.0

func (builder *FileCtrBuilder) SetStrategy(strategy FilenameStrategy) *FileCtrBuilder

type FileInfo added in v1.2.0

type FileInfo struct {
	Hash     string
	Filename string
	FilePath string
	BasePath string
	Size     int64
	Ext      string
}

type FilenameStrategy added in v1.2.0

type FilenameStrategy int
const (
	// Filename
	ContentDisposition FilenameStrategy = iota // filename; as the same as the filename in Content-Disposition
	Hash                                       // hash.ext; md5
	HashHeader                                 // hash-filename
)

Jump to

Keyboard shortcuts

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