19 lines
455 B
Go
19 lines
455 B
Go
|
package protocol
|
||
|
|
||
|
import (
|
||
|
"io"
|
||
|
)
|
||
|
|
||
|
// ServerCodec creates a ServerCodecRequest to process each request.
|
||
|
type ServerCodec interface {
|
||
|
NewRequest(r io.Reader) (ServerCodecRequest, error)
|
||
|
}
|
||
|
|
||
|
// ServerCodecRequest decodes a request and encodes a response using a specific
|
||
|
// serialization scheme.
|
||
|
type ServerCodecRequest interface {
|
||
|
RegistryCodec
|
||
|
WriteResponse(w io.Writer, reply interface{}) error
|
||
|
WriteError(w io.Writer, status int, err error) error
|
||
|
}
|