Documentation ¶
Index ¶
- type Informer
- type Parser
- type ParserOptions
- type Part
- type Processor
- type Request
- func (s *Request) Content() []*Part
- func (request *Request) ContentTypes() []string
- func (request *Request) Filenames() []string
- func (request *Request) GetJSON() ([]string, error)
- func (request *Request) Length() int
- func (s *Request) Save(prefix string, path string, excludedContentTypes ...string) error
- type Saver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Informer ¶ added in v1.0.2
type Informer interface { Content() []*Part Length() int Filenames() []string ContentTypes() []string GetJSON() ([]string, error) }
Informer is a interface that wraps information functions about parsed multipart request
type Parser ¶
Parser is an interface which determine which method to use when parsing multipart files
func NewParser ¶ added in v1.2.0
func NewParser(options ParserOptions) Parser
NewParser creates a new Parser, if you give an empty ParserOptions it uses defaults.
type ParserOptions ¶ added in v1.2.0
type ParserOptions struct { MaxFileSize int MaxFileCount int MaxParseCount int MaxAvailableSlice int Filter func(b []byte) bool }
ParserOptions contains parser's options about parsing. filter function runs when parsing the file
type Part ¶ added in v1.2.0
type Part struct { Name string Headers textproto.MIMEHeader Size int Content []byte }
Part is a struct that you can access the all contents of the multipart.Part
type Processor ¶ added in v1.2.0
Processor is the interface that wraps the Saver and the Informer interfaces.
type Request ¶ added in v1.2.0
type Request struct {
// contains filtered or unexported fields
}
Request implements the Processor interface. contains an array of parts. parser.Parse() returns Request as Processor.
func NewRequest ¶ added in v1.2.0
NewRequest creates a new Request with parts inside
func (*Request) Content ¶ added in v1.2.0
Content method gives you []*Part, so you can access all the data of the parts.
func (*Request) ContentTypes ¶ added in v1.2.0
ContentTypes returns content types of the parts
func (*Request) GetJSON ¶ added in v1.2.0
GetJSON returns json strings of the application/json parts separately