Versions in this module Expand all Collapse all v0 v0.7.0 Mar 19, 2018 Changes in this version + const ContentType + const InternalError + const InvalidParamsError + const InvalidRequestError + const MethodNotFoundError + const ParseError + const Version + func DefaultErrorEncoder(_ context.Context, err error, w http.ResponseWriter) + func DefaultRequestEncoder(_ context.Context, req interface{}) (json.RawMessage, error) + func DefaultResponseDecoder(_ context.Context, res Response) (interface{}, error) + func ErrorMessage(code int) string + type Client struct + func NewClient(tgt *url.URL, method string, options ...ClientOption) *Client + func (c Client) Endpoint() endpoint.Endpoint + type ClientFinalizerFunc func(ctx context.Context, err error) + type ClientOption func(*Client) + func BufferedStream(buffered bool) ClientOption + func ClientAfter(after ...httptransport.ClientResponseFunc) ClientOption + func ClientBefore(before ...httptransport.RequestFunc) ClientOption + func ClientFinalizer(f httptransport.ClientFinalizerFunc) ClientOption + func ClientRequestEncoder(enc EncodeRequestFunc) ClientOption + func ClientRequestIDGenerator(g RequestIDGenerator) ClientOption + func ClientResponseDecoder(dec DecodeResponseFunc) ClientOption + func SetClient(client *http.Client) ClientOption + type DecodeRequestFunc func(context.Context, json.RawMessage) (request interface{}, err error) + type DecodeResponseFunc func(context.Context, Response) (response interface{}, err error) + type EncodeRequestFunc func(context.Context, interface{}) (request json.RawMessage, err error) + type EncodeResponseFunc func(context.Context, interface{}) (response json.RawMessage, err error) + type EndpointCodec struct + Decode DecodeRequestFunc + Encode EncodeResponseFunc + Endpoint endpoint.Endpoint + type EndpointCodecMap map[string]EndpointCodec + type Error struct + Code int + Data interface{} + Message string + func (e Error) Error() string + func (e Error) ErrorCode() int + type ErrorCoder interface + ErrorCode func() int + type Request struct + ID *RequestID + JSONRPC string + Method string + Params json.RawMessage + type RequestID struct + func (id *RequestID) Float32() (float32, error) + func (id *RequestID) Int() (int, error) + func (id *RequestID) String() (string, error) + func (id *RequestID) UnmarshalJSON(b []byte) error + type RequestIDGenerator interface + Generate func() interface{} + func NewAutoIncrementID(init uint64) RequestIDGenerator + type Response struct + Error *Error + JSONRPC string + Result json.RawMessage + type Server struct + func NewServer(ecm EndpointCodecMap, options ...ServerOption) *Server + func (s Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + type ServerOption func(*Server) + func ServerAfter(after ...httptransport.ServerResponseFunc) ServerOption + func ServerBefore(before ...httptransport.RequestFunc) ServerOption + func ServerErrorEncoder(ee httptransport.ErrorEncoder) ServerOption + func ServerErrorLogger(logger log.Logger) ServerOption + func ServerFinalizer(f httptransport.ServerFinalizerFunc) ServerOption