rpc/protocol/client_codec.go

23 lines
489 B
Go
Raw Normal View History

2017-10-31 18:25:44 +09:00
package protocol
import (
"io"
)
// ClientCodec creates a ClientCodecRequest to process each request.
type ClientCodec interface {
2017-11-26 19:15:51 +09:00
WriteRequest(w io.Writer, method string, args interface{}, id interface{}) error
2017-11-29 01:19:03 +09:00
NewResponse(rc io.Reader) (ClientResponseCodec, error)
2017-10-31 18:25:44 +09:00
}
2017-11-26 19:15:51 +09:00
type ClientResponseCodec interface {
2017-11-29 01:19:03 +09:00
Notification() (ClientNotificationCodec, error)
2017-11-01 18:58:16 +09:00
Result(result interface{}) error
2017-10-31 18:25:44 +09:00
Error() error
2017-11-26 19:15:51 +09:00
ID() interface{}
2017-10-31 18:25:44 +09:00
}
2017-11-26 19:15:51 +09:00
type ClientNotificationCodec interface {
2017-10-31 18:25:44 +09:00
RegistryCodec
}