Versions in this module Expand all Collapse all v14 v14.1.0 May 19, 2020 v14.0.0 Feb 18, 2020 Changes in this version + const ErrorCodeInternal + const ErrorCodeInvalidParams + const ErrorCodeInvalidRequest + const ErrorCodeMaxReserved + const ErrorCodeMethodNotFound + const ErrorCodeMinReserved + const ErrorCodeParse + const ErrorMessageInternal + const ErrorMessageInvalidParams + const ErrorMessageInvalidRequest + const ErrorMessageMethodNotFound + const ErrorMessageParse + var DebugMethodFunc = false + func HTTPRequestHandler(methods MethodMap, lgr Logger) http.HandlerFunc + type BatchRequest []Request + func (br BatchRequest) String() string + type BatchResponse []Response + func (br BatchResponse) String() string + type Client struct + BasicAuth bool + DebugRequest bool + Header http.Header + Log Logger + Password string + User string + func (c *Client) Request(ctx context.Context, url, method string, params, result interface{}) error + type Error struct + Code ErrorCode + Data interface{} + Message string + func ErrorInvalidParams(data interface{}) Error + func NewError(code ErrorCode, msg string, data interface{}) Error + func (e Error) Error() string + func (e Error) IsZero() bool + type ErrorCode int + func (c ErrorCode) IsReserved() bool + func (c ErrorCode) String() string + type ErrorUnexpectedHTTPResponse struct + Body []byte + UnmarshlingErr error + func (err *ErrorUnexpectedHTTPResponse) Unwrap() error + func (err ErrorUnexpectedHTTPResponse) Error() string + type Logger interface + Printf func(string, ...interface{}) + Println func(...interface{}) + type MethodFunc func(ctx context.Context, params json.RawMessage) interface + type MethodMap map[string]MethodFunc + type Request struct + ID interface{} + Method string + Params interface{} + func (r *Request) UnmarshalJSON(data []byte) error + func (r Request) MarshalJSON() ([]byte, error) + func (r Request) String() string + type Response struct + Error Error + ID interface{} + Result interface{} + func (r *Response) UnmarshalJSON(data []byte) error + func (r Response) HasError() bool + func (r Response) MarshalJSON() ([]byte, error) + func (r Response) String() string Other modules containing this package github.com/AdamSLevy/jsonrpc2 github.com/AdamSLevy/jsonrpc2/v10 github.com/AdamSLevy/jsonrpc2/v11 github.com/AdamSLevy/jsonrpc2/v12 github.com/AdamSLevy/jsonrpc2/v13 github.com/AdamSLevy/jsonrpc2/v4 github.com/AdamSLevy/jsonrpc2/v8 github.com/AdamSLevy/jsonrpc2/v9