21 lines
507 B
Go
21 lines
507 B
Go
|
package encode
|
||
|
|
||
|
import "io"
|
||
|
|
||
|
// EncoderSelector interface provides a way to select encoder using the http
|
||
|
// request. Typically people can use this to check HEADER of the request and
|
||
|
// figure out client capabilities.
|
||
|
// Eg. "Accept-Encoding" tells about supported compressions.
|
||
|
type EncoderSelector interface {
|
||
|
Select(r io.Reader) Encoder
|
||
|
}
|
||
|
|
||
|
type encoderSelector struct {
|
||
|
}
|
||
|
|
||
|
func (_ *encoderSelector) Select(_ io.Reader) Encoder {
|
||
|
return DefaultEncoder
|
||
|
}
|
||
|
|
||
|
var DefaultEncoderSelector = &encoderSelector{}
|