Versions in this module Expand all Collapse all v0 v0.0.1 May 2, 2022 Changes in this version + var ErrShutdown = errors.New("connection is shut down") + type Call struct + Args interface{} + Done chan *Call + Error error + Method string + Reply interface{} + type Client struct + State *State + func NewClient(logger log.Logger) *Client + func (c *Client) Call(method string, args interface{}, reply interface{}) error + func (c *Client) CallWithContext(ctx context.Context, method string, args interface{}, reply interface{}) error + func (c *Client) Close() error + func (c *Client) DisconnectNotify() chan struct{} + func (c *Client) Go(method string, args interface{}, reply interface{}, done chan *Call) *Call + func (c *Client) Handle(method string, handlerFunc interface{}) + func (c *Client) Notify(method string, args interface{}) error + func (c *Client) Run() + func (c *Client) SetBlocking(blocking bool) + func (c *Client) SetCodec(codec Codec) + type Codec interface + Close func() error + ReadHeader func(*Request, *Response) error + ReadRequestBody func(interface{}) error + ReadResponseBody func(interface{}) error + WriteRequest func(*Request, interface{}) error + WriteResponse func(*Response, interface{}) error + func NewGobCodec(conn io.ReadWriteCloser) Codec + type Request struct + Method string + Seq uint64 + type Response struct + Error string + Seq uint64 + type Server struct + func NewServer(logger log.Logger) *Server + func (s *Server) Handle(method string, handlerFunc interface{}) + func (s *Server) OnConnect(f func(*Client)) + func (s *Server) OnDisconnect(f func(*Client)) + func (s *Server) ServeCodec(codec Codec) + func (s *Server) ServeCodecWithState(codec Codec, state *State) + type ServerError string + func (e ServerError) Error() string + type State struct + func NewState() *State + func (s *State) Get(key string) (value interface{}, ok bool) + func (s *State) Set(key string, value interface{})