2018-04-03 17:58:26 +09:00
|
|
|
package protocol
|
|
|
|
|
|
|
|
// ServerCodec creates a ServerRequestCodec to process each request.
|
|
|
|
type ServerCodec interface {
|
|
|
|
NewRequest(buf []byte) (ServerRequestCodec, error)
|
|
|
|
NewNotification(method string, args []interface{}) ([]byte, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ServerRequestCodec decodes a request and encodes a response using a specific
|
|
|
|
// serialization scheme.
|
|
|
|
type ServerRequestCodec interface {
|
|
|
|
RegistryCodec
|
|
|
|
|
2018-04-05 10:12:33 +09:00
|
|
|
NewResponse(reply interface{}, err error) ([]byte, error)
|
2018-04-03 17:58:26 +09:00
|
|
|
}
|