2017-10-31 09:25:44 +00:00
|
|
|
package protocol
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ClientCodec creates a ClientCodecRequest to process each request.
|
|
|
|
type ClientCodec interface {
|
2018-03-23 13:45:48 +00:00
|
|
|
NewRequestB(method string, args []interface{}, id interface{}) ([]byte, error)
|
|
|
|
NewResponseB(buf []byte) (ClientResponseCodec, error)
|
|
|
|
|
2018-03-20 06:31:54 +00:00
|
|
|
WriteRequest(w io.Writer, method string, args []interface{}, id interface{}) error
|
2018-03-23 09:53:47 +00:00
|
|
|
NewResponse(r 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
|
|
|
|
}
|