Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultInspector ¶ added in v2.0.2
type DefaultInspector struct {
// contains filtered or unexported fields
}
DefaultInspector is the default inspector uses http.DetectContentType function to find the content type
func (*DefaultInspector) Inspect ¶ added in v2.0.2
func (inspector *DefaultInspector) Inspect(data []byte) string
Inspect finds the content type of the byte array
type ExtensionFilter ¶ added in v2.0.2
type ExtensionFilter struct {
// contains filtered or unexported fields
}
ExtensionFilter is a filter which filters the unwanted extensions passes the part if the part's extension is in the extensions field
func (*ExtensionFilter) Filter ¶ added in v2.0.2
func (f *ExtensionFilter) Filter(part *Part) bool
Filter function filters the part with it's extension
type FileSystemStore ¶ added in v2.0.2
type FileSystemStore struct {
Path string
}
FileSystemStore is the default store to save parts
func NewFileSystemStore ¶ added in v2.0.2
func NewFileSystemStore(path string) FileSystemStore
NewFileSystemStore creates a new FileSystemStore
type Filter ¶ added in v2.0.2
Filter is a interface which wraps the Filter function you can create your own filters with this
func NewExtensionFilter ¶ added in v2.0.2
NewExtensionFilter creates a new extension filter
type Inspector ¶ added in v2.0.2
Inspector is a interface for finding the content type of the byte array
func NewDefaultInspector ¶ added in v2.0.2
NewDefaultInspector creates a new default inspector
type Parser ¶
type Parser struct { Options ParserOptions Filter Filter Inspector Inspector }
Parser contains parsing options and interfaces to do some other actions
func DefaultParser ¶ added in v2.0.2
func DefaultParser() *Parser
DefaultParser creates a new parser with the default settings
func (*Parser) Parse ¶
Parse parses the http request with the multipart.Reader. reads parts inside the loop which iterates up to MaxParseCount at most. creates a []byte (buf) which gonna contain the part data.
func (*Parser) SetInspector ¶ added in v2.0.2
SetInspector sets the inspector of the parser
type ParserOptions ¶
ParserOptions contains parser's options about parsing.
type Part ¶
type Part struct { Name string Headers textproto.MIMEHeader Size int Content []byte Extension string }
Part is a struct that you can access the all contents of the multipart.Part
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request contains parts to use in other transactions.
func NewRequest ¶
NewRequest creates a new Request