33 lines
719 B
Go
33 lines
719 B
Go
package protocol
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
// ClientCodec creates a ClientCodecRequest to process each request.
|
|
type ClientCodec interface {
|
|
Write(w io.Writer, method string, args interface{}, id interface{}) error
|
|
NewResponseOrNotify(rc io.Reader) (ClientCodecResponseOrNotify, error)
|
|
}
|
|
|
|
// ClientCodecResponseOrNotify encodes a response or notify using a specific
|
|
// serialization scheme.
|
|
type ClientCodecResponseOrNotify interface {
|
|
IsResponse() bool
|
|
IsNotify() bool
|
|
GetResponse() ClientCodecResponse
|
|
GetNotify() ClientCodecNotify
|
|
Complete()
|
|
}
|
|
|
|
type ClientCodecResponse interface {
|
|
ID() interface{}
|
|
Result(result interface{}) error
|
|
Error() error
|
|
Complete()
|
|
}
|
|
|
|
type ClientCodecNotify interface {
|
|
RegistryCodec
|
|
}
|