rpc/protocol/client_codec.go

23 lines
489 B
Go
Raw Normal View History

2017-10-31 09:25:44 +00:00
package protocol
import (
"io"
)
// ClientCodec creates a ClientCodecRequest to process each request.
type ClientCodec interface {
2017-11-26 10:15:51 +00:00
WriteRequest(w io.Writer, method string, args interface{}, id interface{}) error
2017-11-28 16:19:03 +00:00
NewResponse(rc io.Reader) (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
2017-10-31 09:25:44 +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
}