Documentation
¶
Index ¶
- Constants
- Variables
- func EncodeControl(f ControlFrame) ([]byte, error)
- func EncodeControlFrame(streamID uint64, frame ControlFrame) ([]byte, error)
- func EncodeDataFrame(streamID uint64, payload []byte) ([]byte, error)
- func EncodeWireFrame(frame WireFrame) ([]byte, error)
- type ControlFrame
- type DataFrame
- type FrameKind
- type FrameType
- type WireFrame
Constants ¶
View Source
const ( FrameRegister FrameType = "register" FrameRegisterAck FrameType = "register_ack" FrameHeartbeat FrameType = "heartbeat" FrameHeartbeatAck FrameType = "heartbeat_ack" FrameOpen FrameType = "open" FrameOpenAck FrameType = "open_ack" FrameClose FrameType = "close" FrameError FrameType = "error" FrameData FrameType = "data" KindControl FrameKind = 1 KindData FrameKind = 2 )
View Source
const Version1 byte = 1
Variables ¶
Functions ¶
func EncodeControl ¶
func EncodeControl(f ControlFrame) ([]byte, error)
func EncodeControlFrame ¶
func EncodeControlFrame(streamID uint64, frame ControlFrame) ([]byte, error)
func EncodeWireFrame ¶
Types ¶
type ControlFrame ¶
type ControlFrame struct {
Type FrameType `json:"type"`
StreamID uint64 `json:"stream_id,omitempty"`
ClientID string `json:"client_id,omitempty"`
Target string `json:"target,omitempty"`
Message string `json:"message,omitempty"`
SessionID string `json:"session_id,omitempty"`
PreviousSessionID string `json:"previous_session_id,omitempty"`
Meta json.RawMessage `json:"meta,omitempty"`
}
func DecodeControl ¶
func DecodeControl(b []byte) (ControlFrame, error)
func DecodeControlFromWire ¶
func DecodeControlFromWire(wf WireFrame) (ControlFrame, error)
Click to show internal directories.
Click to hide internal directories.