Versions in this module Expand all Collapse all v1 v1.0.0 Jun 4, 2021 Changes in this version + var DebugLog = false + 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(conn io.ReadWriteCloser) *Client + func NewClientWithCodec(codec Codec) *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) + 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() *Server + func (s *Server) Accept(lis net.Listener) + 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) + func (s *Server) ServeConn(conn io.ReadWriteCloser) + 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{})