2016-02-15 23:42:52 +00:00
|
|
|
package protocol
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
|
|
|
type RequestEncoder interface {
|
2016-02-25 20:50:10 +00:00
|
|
|
EncodeRequestHeader(*RequestHeader, io.Writer)
|
|
|
|
EncodeRequestBody(io.Writer) io.Writer
|
2016-02-15 23:42:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type RequestDecoder interface {
|
2016-02-26 23:05:53 +00:00
|
|
|
DecodeRequestHeader(io.Reader) (*RequestHeader, error)
|
2016-02-25 20:50:10 +00:00
|
|
|
DecodeRequestBody(io.Reader) io.Reader
|
2016-02-15 23:42:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ResponseEncoder interface {
|
2016-02-25 20:50:10 +00:00
|
|
|
EncodeResponseHeader(*ResponseHeader, io.Writer)
|
|
|
|
EncodeResponseBody(io.Writer) io.Writer
|
2016-02-15 23:42:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ResponseDecoder interface {
|
2016-02-26 23:05:53 +00:00
|
|
|
DecodeResponseHeader(io.Reader) (*ResponseHeader, error)
|
2016-02-25 20:50:10 +00:00
|
|
|
DecodeResponseBody(io.Reader) io.Reader
|
2016-02-15 23:42:52 +00:00
|
|
|
}
|