Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder interface {
New() DecoderFunc
}
Decoder is simply a decoder factory that returns a new decoder func for every request (but only in case it is encoded)
type DecoderFunc ¶
DecoderFunc is a function that takes encoded byte-slice and returns decoded one
type Decoders ¶
type Decoders struct {
// contains filtered or unexported fields
}
Decoders structure just encapsulates containing content decoders. This used for some http-compatibility actions like backward capability for compress and x-compress, gzip and x-gzip
func NewContentDecoders ¶
func NewContentDecoders() Decoders
NewContentDecoders returns new instance of Decoders
func (Decoders) Acceptable ¶
Acceptable returns a string with all the available decoders, listed by comma. In case no decoders are presented, identity is used to notify a client that server does not accept any encodings
func (Decoders) Add ¶
Add simply adds a new decoder. In case gzip or compress is passed also x-gzip and x-compress keys will be automatically appended, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding#directives
func (Decoders) AddDecoder ¶
func (d Decoders) AddDecoder(token string, decoderFunc DecoderFunc)
AddDecoder does the same as Add except it adds directly decoderFunc. Left mostly in backward capability purposes