rpc/protocol/client_codec.go

19 lines
467 B
Go
Raw Normal View History

2017-10-31 09:25:44 +00:00
package protocol
// ClientCodec creates a ClientCodecRequest to process each request.
type ClientCodec interface {
2018-03-23 17:26:41 +00:00
NewRequest(method string, args []interface{}, id interface{}) ([]byte, error)
NewResponse(buf []byte) (ClientResponseCodec, error)
2017-10-31 09:25:44 +00:00
}
2017-11-26 10:15:51 +00:00
type ClientResponseCodec interface {
2017-11-28 16:19:03 +00:00
Notification() (ClientNotificationCodec, error)
2017-11-01 09:58:16 +00:00
Result(result interface{}) error
2018-03-27 11:23:43 +00:00
Error() *Error
2017-11-26 10:15:51 +00:00
ID() interface{}
2017-10-31 09:25:44 +00:00
}
2017-11-26 10:15:51 +00:00
type ClientNotificationCodec interface {
2017-10-31 09:25:44 +00:00
RegistryCodec
}