Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientSetup ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func ConnectionFromWebsocket ¶
func ConnectionFromWebsocket(conn *websocket.Conn) (*Connection, error)
func NewClientConnection ¶
func NewClientConnection(cs *ClientSetup) (*Connection, error)
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) Receive ¶
func (c *Connection) Receive() (msg *Message, ok bool)
func (*Connection) Send ¶
func (c *Connection) Send(msg *Message)
type Message ¶
type Message struct { N int `json:"n,omitempty"` Err error `json:"error,omitepty"` Frame []byte `json:"frame,omitempty"` Sequence uint64 `json:"seq,omitempty"` // WriteAck is an optional function that you can set when // providing a message to the Write routine, to have the write // byte count and error returned, after the respective write. WriteAck func(int, error) error // TimeAt is an output only field that's set // only when receiving to indicate the time that // a message was received. TimeAt time.Time `json:"time_at,omitempty"` }
Click to show internal directories.
Click to hide internal directories.