Documentation ¶
Index ¶
- type Client
- func (c *Client) Close()
- func (c *Client) ID() string
- func (c *Client) Metadata() string
- func (c *Client) SetMetadata(metadata string)
- func (c *Client) Subscribe(ctx context.Context, handle func(wsmessage.Message)) error
- func (c *Client) WriteChannel() chan<- wsmessage.Message
- func (c *Client) WriteTimeout(ctx context.Context, timeout time.Duration, msg wsmessage.Message) error
- type WSReadWriter
- type WSReader
- type WSWriter
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
}
An abstraction for sending out to websocket using channels.
func NewClientWithID ¶
func NewClientWithID(conn WSReadWriter, id string) *Client
func (*Client) SetMetadata ¶
func (*Client) WriteChannel ¶
Gets the channel to write out to. Messages sent here will be written to the websocket and received by the other side.
type WSReadWriter ¶
Click to show internal directories.
Click to hide internal directories.