rpc/encode/encode.go
crusader 8e43174376 ing
2017-10-31 18:25:44 +09:00

24 lines
391 B
Go

package encode
import "io"
// Encoder interface contains the encoder for response.
// Eg. gzip, flate compressions.
type Encoder interface {
Encode(w io.Writer) io.Writer
Decode(r io.Reader) io.Reader
}
type encoder struct {
}
func (_ *encoder) Encode(w io.Writer) io.Writer {
return w
}
func (_ *encoder) Decode(r io.Reader) io.Reader {
return r
}
var DefaultEncoder = &encoder{}