Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNormalCloseError ¶
func IsWebSocketUpgrade ¶
Types ¶
type CallErrorMessage ¶
type CallErrorMessage struct {
// contains filtered or unexported fields
}
func NewCallErrorMessage ¶
func NewCallErrorMessage(id MessageID, errorCode ErrorCode, errorDescription string) *CallErrorMessage
func (*CallErrorMessage) Error ¶
func (err *CallErrorMessage) Error() string
func (*CallErrorMessage) ID ¶
func (err *CallErrorMessage) ID() MessageID
func (*CallErrorMessage) MarshalJSON ¶
func (err *CallErrorMessage) MarshalJSON() ([]byte, error)
func (*CallErrorMessage) Type ¶
func (err *CallErrorMessage) Type() MessageType
type CallMessage ¶
type CallMessage struct { Action Payload map[string]interface{} // contains filtered or unexported fields }
func NewCallMessage ¶
func NewCallMessage(id MessageID, action Action, payload map[string]interface{}) *CallMessage
func UnmarshalRequest ¶
func UnmarshalRequest(id MessageID, req messages.Request) (*CallMessage, error)
func (*CallMessage) ID ¶
func (call *CallMessage) ID() MessageID
func (*CallMessage) MarshalJSON ¶
func (call *CallMessage) MarshalJSON() ([]byte, error)
func (*CallMessage) Type ¶
func (call *CallMessage) Type() MessageType
type CallResponse ¶
type CallResponse struct {
// contains filtered or unexported fields
}
type CallResultMessage ¶
type CallResultMessage struct { Payload interface{} //map[string]interface{} // contains filtered or unexported fields }
func NewCallResult ¶
func NewCallResult(id MessageID, payload interface{}) *CallResultMessage
func (*CallResultMessage) ID ¶
func (result *CallResultMessage) ID() MessageID
func (*CallResultMessage) MarshalJSON ¶
func (result *CallResultMessage) MarshalJSON() ([]byte, error)
func (*CallResultMessage) Type ¶
func (result *CallResultMessage) Type() MessageType
type Conn ¶
func (*Conn) ReadMessage ¶
func (*Conn) SendRequest ¶
func (*Conn) SendResponse ¶
type ErrorCode ¶
type ErrorCode string
const ( // NotSupported when Requested Action is recognized but not supported by the receiver NotSupported ErrorCode = "NotSupported" // InternalError when An internal error occurred and the receiver was not able to process the requested Action successfully InternalError ErrorCode = "InternalError" // ProtocolError when Payload for Action is incomplete ProtocolError ErrorCode = "ProtocolError" // SecurityError when During the processing of Action a security issue occurred preventing receiver from completing the Action successfully SecurityError ErrorCode = "SecurityError" // FormationViolation when Payload for Action is syntactically incorrect or not conform the PDU structure for Action FormationViolation ErrorCode = "FormationViolation" // PropertyConstraintViolation when Payload is syntactically correct but at least one field contains an invalid value PropertyConstraintViolation ErrorCode = "PropertyConstraintViolation" // OccurenceConstraintViolation when Payload for Action is syntactically correct but at least one of the fields violates occurence constraints OccurenceConstraintViolation ErrorCode = "OccurenceConstraintViolation" // TypeConstraintViolation when Payload for Action is syntactically correct but at least one of the fields violates data type constraints (e.g. “somestring”: 12) TypeConstraintViolation ErrorCode = "TypeConstraintViolation" // GenericError when Any other error not covered by the previous ones GenericError ErrorCode = "GenericError" // Nil no error Nil ErrorCode = "" )
type MessageType ¶
type MessageType float64
const ( Call MessageType = 2 CallResult MessageType = 3 CallError MessageType = 4 )
Click to show internal directories.
Click to hide internal directories.