26 lines
626 B
Go
26 lines
626 B
Go
package protocol
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
// ClientCodec creates a ClientCodecRequest to process each request.
|
|
type ClientCodec interface {
|
|
NewRequestB(method string, args []interface{}, id interface{}) ([]byte, error)
|
|
NewResponseB(buf []byte) (ClientResponseCodec, error)
|
|
|
|
WriteRequest(w io.Writer, method string, args []interface{}, id interface{}) error
|
|
NewResponse(r io.Reader) (ClientResponseCodec, error)
|
|
}
|
|
|
|
type ClientResponseCodec interface {
|
|
Notification() (ClientNotificationCodec, error)
|
|
Result(result interface{}) error
|
|
Error() error
|
|
ID() interface{}
|
|
}
|
|
|
|
type ClientNotificationCodec interface {
|
|
RegistryCodec
|
|
}
|