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 { SelectByReader(r io.Reader) Encoder SelectByWriter(w io.Writer) Encoder } type encoderSelector struct { } func (_ *encoderSelector) SelectByReader(_ io.Reader) Encoder { return DefaultEncoder } func (_ *encoderSelector) SelectByWriter(_ io.Writer) Encoder { return DefaultEncoder } var DefaultEncoderSelector = &encoderSelector{}