Versions in this module Expand all Collapse all v1 v1.2.3 Dec 12, 2019 v1.2.2 Dec 12, 2019 v1.2.0 Dec 12, 2019 v1.0.0 Dec 12, 2019 v0 v0.0.2 Dec 12, 2019 v0.0.1 Dec 12, 2019 Changes in this version + const CodeInternalError + const CodeInvalidParams + const CodeInvalidRequest + const CodeMethodNotFound + const CodeParseError + const DefaultHTTPRspBufferSize + const DefaultMaxSleepTime + const JSONRPC + const MAX_JSONRPC_ID + const PathPrefix + const VERSION + var Version = "2.0" + func GetProtocol() protocol.Protocol + type CodecData struct + Args interface{} + Error string + ID int64 + Method string + type Error struct + Code int + Data interface{} + Message string + func NewError(code int, message string) *Error + func (e *Error) Error() string + type HTTPClient struct + ID int64 + func NewHTTPClient(opt *HTTPOptions) *HTTPClient + func (c *HTTPClient) Call(ctx context.Context, service common.URL, req *Request, rsp interface{}) error + func (c *HTTPClient) Do(addr, path string, httpHeader http.Header, body []byte) ([]byte, error) + func (c *HTTPClient) NewRequest(service common.URL, method string, args interface{}) *Request + type HTTPOptions struct + HTTPTimeout time.Duration + HandshakeTimeout time.Duration + type JsonrpcExporter struct + func NewJsonrpcExporter(key string, invoker protocol.Invoker, exporterMap *sync.Map) *JsonrpcExporter + func (je *JsonrpcExporter) Unexport() + type JsonrpcInvoker struct + func NewJsonrpcInvoker(url common.URL, client *HTTPClient) *JsonrpcInvoker + func (ji *JsonrpcInvoker) Invoke(invocation protocol.Invocation) protocol.Result + type JsonrpcProtocol struct + func NewJsonrpcProtocol() *JsonrpcProtocol + func (jp *JsonrpcProtocol) Destroy() + func (jp *JsonrpcProtocol) Export(invoker protocol.Invoker) protocol.Exporter + func (jp *JsonrpcProtocol) Refer(url common.URL) protocol.Invoker + type Request struct + ID int64 + type Server struct + func NewServer() *Server + func (s *Server) Start(url common.URL) + func (s *Server) Stop() + type ServerCodec struct + func (c *ServerCodec) ReadBody(x interface{}) error + func (c *ServerCodec) ReadHeader(header map[string]string, body []byte) error + func (c *ServerCodec) Write(errMsg string, x interface{}) ([]byte, error)