Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoResult = errors.New("no result in JSON-RPC response")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type Message ¶
type Message struct { Version string `json:"jsonrpc,omitempty"` // The type of the ID field must be json.Message because the interface{} type cannot perform type comparisons correctly during the process. // For example, in respWait(sync.Map), the request is of type int, but it becomes float64 when in response. ID json.RawMessage `json:"id,omitempty"` Method string `json:"method,omitempty"` // If this is an instance of Subscription, the Params is json.Marshal(api.SubscriptionResult) Params json.RawMessage `json:"params,omitempty"` Error *api.JsonRpcError `json:"error,omitempty"` Result json.RawMessage `json:"result,omitempty"` }
Message A value of this type can a JSON-RPC request, notification, successful response or error response. Which one it is depends on the fields.
func (*Message) HasValidID ¶
func (*Message) IsNotification ¶
func (*Message) IsResponse ¶
type MessageReader ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents an RPC Server.
func (*Server) RegisterName ¶
RegisterName is like Register but uses the provided name for the type instead of the receiver's concrete type.
Click to show internal directories.
Click to hide internal directories.