2017-10-31 18:25:44 +09:00
|
|
|
package protocol
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ClientCodec creates a ClientCodecRequest to process each request.
|
|
|
|
type ClientCodec interface {
|
2018-03-23 16:43:05 +09:00
|
|
|
NewDecoder(r io.Reader) interface{}
|
|
|
|
|
2018-03-20 15:31:54 +09:00
|
|
|
WriteRequest(w io.Writer, method string, args []interface{}, id interface{}) error
|
2018-03-23 16:43:05 +09:00
|
|
|
NewResponse(decoder interface{}) (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
|
|
|
|
}
|