Versions in this module Expand all Collapse all v1 v1.2.0 Jun 1, 2017 Changes in this version + const ConnKey + const DefaultDebugPath + const DefaultRPCPath + const HeaderKey + var DefaultServer = NewServer() + var ErrShutdown = errors.New("connection is shut down") + func Accept(lis net.Listener) + func FromMapContext(ctx context.Context) (m map[string]interface{}, ok bool) + func HandleHTTP() + func NewContext(ctx context.Context, header Header) context.Context + func NewMapContext(ctx context.Context) context.Context + func Register(rcvr interface{}) error + func RegisterName(name string, rcvr interface{}) error + func ServeCodec(codec ServerCodec) + func ServeConn(conn io.ReadWriteCloser) + func ServeRequest(codec ServerCodec) error + type Call struct + Args interface{} + Done chan *Call + Error error + Reply interface{} + ServiceMethod string + type Client struct + func Dial(network, address string) (*Client, error) + func DialHTTP(network, address string) (*Client, error) + func DialHTTPPath(network, address, path string) (*Client, error) + func NewClient(conn io.ReadWriteCloser) *Client + func NewClientWithCodec(codec ClientCodec) *Client + func (client *Client) Call(ctx context.Context, serviceMethod string, args interface{}, reply interface{}) error + func (client *Client) Close() error + func (client *Client) Go(ctx context.Context, serviceMethod string, args interface{}, reply interface{}, ...) *Call + type ClientCodec interface + Close func() error + ReadResponseBody func(interface{}) error + ReadResponseHeader func(*Response) error + WriteRequest func(context.Context, *Request, interface{}) error + type Header map[string][]string + func FromContext(ctx context.Context) (header Header, ok bool) + func NewHeader() Header + func (h Header) Add(key, value string) + func (h Header) Del(key string) + func (h Header) Get(key string) string + func (h Header) Len() int + func (h Header) Set(key, value string) + func (h Header) String() string + type Request struct + Header string + Seq uint64 + ServiceMethod string + type Response struct + Error string + Header string + Seq uint64 + ServiceMethod string + type Server struct + func NewServer() *Server + func (server *Server) Accept(lis net.Listener) + func (server *Server) HandleHTTP(rpcPath, debugPath string) + func (server *Server) Register(rcvr interface{}) error + func (server *Server) RegisterName(name string, rcvr interface{}) error + func (server *Server) ServeCodec(codec ServerCodec) + func (server *Server) ServeConn(conn io.ReadWriteCloser) + func (server *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) + func (server *Server) ServeRequest(codec ServerCodec) error + type ServerCodec interface + Close func() error + ReadRequestBody func(context.Context, interface{}) error + ReadRequestHeader func(context.Context, *Request) error + WriteResponse func(context.Context, *Response, interface{}) error + type ServerError string + func (e ServerError) Error() string