Documentation
¶
Index ¶
- Constants
- type Body
- func NewBody(t string, c Config) *Body
- func NewError(message string) *Body
- func NewForm(data ...*FormEntry) *Body
- func NewHTML(content string) *Body
- func NewImage(t string, bytes []byte) *Body
- func NewJSON(msg interface{}) *Body
- func NewLarge(filename string, contentType string, length int64) *Body
- func NewRaw(bytes []byte) *Body
- func NewXML(content string) *Body
- func Parse(path string, contentEncoding string, contentType string, charset string, ...) (*Body, error)
- type Config
- type Error
- type Form
- type FormData
- type FormEntry
- type HTML
- type Image
- type JSON
- type Large
- type Raw
- type XML
Constants ¶
View Source
const KeyError = "error"
View Source
const KeyForm = "form"
View Source
const KeyHTML = "html"
View Source
const KeyImage = "image"
View Source
const KeyJSON = "json"
View Source
const KeyLarge = "large"
View Source
const KeyRaw = "raw"
View Source
const KeyXML = "xml"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Body ¶
type Body struct {
Type string `json:"type"`
Length int64 `json:"length"`
Config Config `json:"config"`
}
func (*Body) ContentLength ¶
func (*Body) ToHTTP ¶
func (b *Body) ToHTTP() io.ReadCloser
func (*Body) UnmarshalJSON ¶
type Form ¶
type Form struct {
Data FormData `json:"data"`
// contains filtered or unexported fields
}
func (*Form) ContentLength ¶
type Image ¶
func (*Image) ContentLength ¶
type JSON ¶
type JSON struct {
Msg interface{} `json:"msg"`
// contains filtered or unexported fields
}
func (*JSON) ContentLength ¶
type Large ¶
type Large struct {
Filename string `json:"filename"`
ContentType string `json:"contentType"`
Length int64 `json:"length"`
}
func (*Large) ContentLength ¶
type Raw ¶
type Raw struct {
Type string `json:"type"`
Content string `json:"content"`
Length int64 `json:"length,omitempty"`
Binary bool `json:"binary,omitempty"`
}
func (*Raw) ContentLength ¶
Click to show internal directories.
Click to hide internal directories.