rpc-go/protocol/server_codec.go

17 lines
495 B
Go
Raw Normal View History

2018-04-03 08:58:26 +00: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
NewResponse(reply interface{}) ([]byte, error)
NewError(status int, err error) ([]byte, error)
}