Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a websocket implementation of the Transport interface
func (*Client) Close ¶
func (c *Client) Close()
Close attempts to gracefully close the websocket connection
func (*Client) GetTransportUpdate ¶
func (c *Client) GetTransportUpdate() *helix.TransportUpdate
GetTransportUpdate returns a helix.TransportUpdate for the websocket transport, used for updating conduits
func (*Client) OnChannelMessage ¶
func (c *Client) OnChannelMessage(f func(message helix.ChannelMessage))
OnChannelMessage sets a callback to be called when a channel message is received, is not executed in gorourines. It is the responsibility of the caller to handle concurrency.
type Message ¶
type Message struct { Metadata MessageMetadata `json:"metadata"` Payload json.RawMessage `json:"payload"` }
Message is the structure of a message received from the websocket
type MessageMetadata ¶
type MessageMetadata struct { MessageID string `json:"message_id"` MessageType MessageType `json:"message_type"` MessageTimestamp string `json:"message_timestamp"` SubscriptionType helix.EventType `json:"subscription_type,omitempty"` SubscriptionVersion string `json:"subscription_version,omitempty"` }
MessageMetadata is the metadata of a message received from the websocket
type MessageType ¶
type MessageType string
MessageType is the type of message received from the websocket
const ( MessageTypeWelcome MessageType = "session_welcome" MessageTypeKeepalive MessageType = "session_keepalive" MessageTypeNotification MessageType = "notification" )
type SystemMessagePayload ¶
type SystemMessagePayload struct {
Session *SystemMessagePayloadSession `json:"session,omitempty"`
}
SystemMessagePayload is the payload of a system/session message
type SystemMessagePayloadSession ¶
type SystemMessagePayloadSession struct { ID string `json:"id"` Status string `json:"status"` ConectedAt string `json:"connected_at"` KeepaliveTimeoutSeconds int `json:"keepalive_timeout_seconds"` ReconnectUrl string `json:"reconnect_url,omitempty"` }
SystemMessagePayloadSession is the payload of a system/session message