Documentation
¶
Index ¶
- func ETagResponseWriter(config *ETagConfig) martini.Handler
- type ETagConfig
- func (t *ETagConfig) AddIgnoreHeaderExist(header string, exist bool) *ETagConfig
- func (t *ETagConfig) AddIgnoreHeaderValue(header string, value string) *ETagConfig
- func (t *ETagConfig) AddMethod(method string) *ETagConfig
- func (t *ETagConfig) AddStatus(status int) *ETagConfig
- func (t *ETagConfig) SetHashFunc(hashFunc ETagHashFunc) *ETagConfig
- func (t *ETagConfig) SetMinBodyLength(length int) *ETagConfig
- type ETagHashFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ETagResponseWriter ¶
func ETagResponseWriter(config *ETagConfig) martini.Handler
ETagResponseWriter return martini Handler by ETagConfig
Types ¶
type ETagConfig ¶
type ETagConfig struct { MinBodyLength int EnableMethod map[string]bool EnableStatus map[int]bool IgnoreIfHeaderExist map[string]bool IgnoreIfHeaderValue map[string]string HashFunc ETagHashFunc }
ETagConfig config for ETag
func (*ETagConfig) AddIgnoreHeaderExist ¶
func (t *ETagConfig) AddIgnoreHeaderExist(header string, exist bool) *ETagConfig
AddIgnoreHeaderExist ignore etag if header exist
func (*ETagConfig) AddIgnoreHeaderValue ¶
func (t *ETagConfig) AddIgnoreHeaderValue(header string, value string) *ETagConfig
AddIgnoreHeaderValue ignore etag if header equal value
func (*ETagConfig) AddMethod ¶
func (t *ETagConfig) AddMethod(method string) *ETagConfig
AddMethod allow request method for etag
func (*ETagConfig) AddStatus ¶
func (t *ETagConfig) AddStatus(status int) *ETagConfig
AddStatus allow response status for etag
func (*ETagConfig) SetHashFunc ¶
func (t *ETagConfig) SetHashFunc(hashFunc ETagHashFunc) *ETagConfig
SetHashFunc set etag hash function
func (*ETagConfig) SetMinBodyLength ¶
func (t *ETagConfig) SetMinBodyLength(length int) *ETagConfig
SetMinBodyLength if response body size less than length, do not use etag
type ETagHashFunc ¶
ETagHashFunc hash function for generate etag from response body
Click to show internal directories.
Click to hide internal directories.