Documentation ¶
Index ¶
- Variables
- type BufferController
- func (c *BufferController) BeforeWrite()
- func (c *BufferController) BeforeWriteHeader()
- func (c *BufferController) Discard()
- func (c *BufferController) Discarded() bool
- func (c *BufferController) Error() error
- func (c *BufferController) WithChecker(v Validator) *BufferController
- func (c *BufferController) WithWriter(w io.Writer) *BufferController
- func (c *BufferController) Write(data []byte)
- type CommitController
- type Controller
- type Extractor
- type ExtractorField
- type ExtractorFunc
- type Field
- type FieldFunc
- type Formatter
- type FormatterFunc
- type Info
- type NopController
- type Response
- func (resp *Response) Autocommit() bool
- func (resp *Response) Commit() error
- func (resp *Response) Header() http.Header
- func (resp *Response) LastError() error
- func (resp *Response) Locked() bool
- func (resp *Response) SetUncommittedData(data []byte)
- func (resp *Response) UncommittedData() []byte
- func (resp *Response) UpdateAutocommit(autocommit bool) bool
- func (resp *Response) UpdateController(c Controller) bool
- func (resp *Response) WrapWriter(rw http.ResponseWriter) middleware.ResponseWriter
- type StringField
- type Validator
- type ValidatorFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ValidatorAlways = ValidatorFunc(func(*http.Request, *Response) (bool, error) { return true, nil })
View Source
var ValidatorNever = ValidatorFunc(func(*http.Request, *Response) (bool, error) { return false, nil })
Functions ¶
This section is empty.
Types ¶
type BufferController ¶
type BufferController struct { NopController // contains filtered or unexported fields }
func NewBufferController ¶
func NewBufferController(req *http.Request, resp *Response) *BufferController
func (*BufferController) BeforeWrite ¶
func (c *BufferController) BeforeWrite()
func (*BufferController) BeforeWriteHeader ¶
func (c *BufferController) BeforeWriteHeader()
func (*BufferController) Discard ¶
func (c *BufferController) Discard()
func (*BufferController) Discarded ¶
func (c *BufferController) Discarded() bool
func (*BufferController) Error ¶
func (c *BufferController) Error() error
func (*BufferController) WithChecker ¶
func (c *BufferController) WithChecker(v Validator) *BufferController
func (*BufferController) WithWriter ¶
func (c *BufferController) WithWriter(w io.Writer) *BufferController
func (*BufferController) Write ¶
func (c *BufferController) Write(data []byte)
type CommitController ¶
type CommitController struct { NopController // contains filtered or unexported fields }
func NewCommitController ¶
func NewCommitController(req *http.Request, resp *Response) *CommitController
func (*CommitController) BeforeWrite ¶
func (c *CommitController) BeforeWrite()
func (*CommitController) BeforeWriteHeader ¶
func (c *CommitController) BeforeWriteHeader()
func (*CommitController) WithChecker ¶
func (c *CommitController) WithChecker(v Validator) *CommitController
type Controller ¶
var DefaultController Controller = &NopController{}
type ExtractorField ¶
func NewExtractorField ¶
func NewExtractorField() *ExtractorField
func (*ExtractorField) IdentifyRequest ¶
func (f *ExtractorField) IdentifyRequest(r *http.Request) (string, error)
func (*ExtractorField) WithExtrator ¶
func (f *ExtractorField) WithExtrator(e Extractor) *ExtractorField
func (*ExtractorField) WithFormatters ¶
func (f *ExtractorField) WithFormatters(formatters ...Formatter) *ExtractorField
type ExtractorFunc ¶
type FormatterFunc ¶
type NopController ¶
type NopController struct { }
func (*NopController) BeforeWrite ¶
func (p *NopController) BeforeWrite()
func (*NopController) BeforeWriteHeader ¶
func (p *NopController) BeforeWriteHeader()
func (*NopController) Error ¶
func (p *NopController) Error() error
func (*NopController) Write ¶
func (p *NopController) Write([]byte)
type Response ¶
type Response struct { StatusCode int //StatusCode response status code.Default value 200 ContentLength int //ContentLength response content length. Written bool //Content written // contains filtered or unexported fields }
Response standard http response infomation
func (*Response) Autocommit ¶
func (*Response) SetUncommittedData ¶
func (*Response) UncommittedData ¶
func (*Response) UpdateAutocommit ¶
func (*Response) UpdateController ¶
func (resp *Response) UpdateController(c Controller) bool
func (*Response) WrapWriter ¶
func (resp *Response) WrapWriter(rw http.ResponseWriter) middleware.ResponseWriter
WrapWriter wrap http response writer
type StringField ¶
type StringField struct {
Field Field
}
StringField string field
func NewStringField ¶
func NewStringField(f Field) *StringField
func (*StringField) LoadStringInfo ¶
func (f *StringField) LoadStringInfo(r *http.Request) (string, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.