gotools/internal/jsonrpc2/messages.go

type Message

type Request

type Notification

type Call

type Response

// NewNotification constructs a new Notification message for the supplied
// method and parameters.
func NewNotification(method string, params interface{}

func (msg *Notification) Method() string          {}

func (msg *Notification) Params() json.RawMessage {}

func (msg *Notification) isJSONRPC2Message()      {}

func (msg *Notification) isJSONRPC2Request()      {}

func (n *Notification) MarshalJSON() ([]byte, error) {}

func (n *Notification) UnmarshalJSON(data []byte) error {}

// NewCall constructs a new Call message for the supplied ID, method and
// parameters.
func NewCall(id ID, method string, params interface{}

func (msg *Call) Method() string          {}

func (msg *Call) Params() json.RawMessage {}

func (msg *Call) ID() ID                  {}

func (msg *Call) isJSONRPC2Message()      {}

func (msg *Call) isJSONRPC2Request()      {}

func (c *Call) MarshalJSON() ([]byte, error) {}

func (c *Call) UnmarshalJSON(data []byte) error {}

// NewResponse constructs a new Response message that is a reply to the
// supplied. If err is set result may be ignored.
func NewResponse(id ID, result interface{}

func (msg *Response) ID() ID                  {}

func (msg *Response) Result() json.RawMessage {}

func (msg *Response) Err() error              {}

func (msg *Response) isJSONRPC2Message()      {}

func (r *Response) MarshalJSON() ([]byte, error) {}

func toWireError(err error) *WireError {}

func (r *Response) UnmarshalJSON(data []byte) error {}

func DecodeMessage(data []byte) (Message, error) {}

func marshalToRaw(obj interface{}