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