rpc/protocol/server_codec.go
crusader 0b1486a3bd ing
2018-03-24 02:26:41 +09:00

17 lines
495 B
Go

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
NewResponse(reply interface{}) ([]byte, error)
NewError(status int, err error) ([]byte, error)
}