Documentation ¶
Index ¶
- func ErrorResponse(w http.ResponseWriter, r *http.Request, err error, status int, message string)
- func NewErrorJSON(id interface{}, code int, message string) *simplejson.Json
- type CID
- type RPCMessage
- func NewErrorMessage(id interface{}, code int, message string) RPCMessage
- func NewNotifyMessage(serviceName string, method string, params []interface{}) RPCMessage
- func NewRPCMessage(data *simplejson.Json) RPCMessage
- func NewResultMessage(id interface{}, result interface{}) RPCMessage
- func ParseMessage(data []byte) (RPCMessage, error)
- func (self RPCMessage) GetIntId() (int64, error)
- func (self RPCMessage) GetParams() []interface{}
- func (self RPCMessage) IsError() bool
- func (self RPCMessage) IsNotify() bool
- func (self RPCMessage) IsRequest() bool
- func (self RPCMessage) IsResult() bool
- func (self RPCMessage) IsResultOrError() bool
- func (self RPCMessage) IsValid() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorResponse ¶
func NewErrorJSON ¶
Types ¶
type RPCMessage ¶
type RPCMessage struct { Initialized bool FromConnId CID Id interface{} ServiceName string Method string Params *simplejson.Json Result *simplejson.Json Error *simplejson.Json Raw *simplejson.Json }
func NewErrorMessage ¶
func NewErrorMessage(id interface{}, code int, message string) RPCMessage
func NewNotifyMessage ¶
func NewNotifyMessage(serviceName string, method string, params []interface{}) RPCMessage
func NewRPCMessage ¶
func NewRPCMessage(data *simplejson.Json) RPCMessage
func NewResultMessage ¶
func NewResultMessage(id interface{}, result interface{}) RPCMessage
func ParseMessage ¶
func ParseMessage(data []byte) (RPCMessage, error)
func (RPCMessage) GetIntId ¶
func (self RPCMessage) GetIntId() (int64, error)
func (RPCMessage) GetParams ¶
func (self RPCMessage) GetParams() []interface{}
func (RPCMessage) IsError ¶
func (self RPCMessage) IsError() bool
func (RPCMessage) IsNotify ¶
func (self RPCMessage) IsNotify() bool
func (RPCMessage) IsRequest ¶
func (self RPCMessage) IsRequest() bool
func (RPCMessage) IsResult ¶
func (self RPCMessage) IsResult() bool
func (RPCMessage) IsResultOrError ¶
func (self RPCMessage) IsResultOrError() bool
func (RPCMessage) IsValid ¶
func (self RPCMessage) IsValid() bool
Click to show internal directories.
Click to hide internal directories.