Documentation
¶
Index ¶
- type Client
- func (c *Client) Close()
- func (c *Client) GetEvents() []string
- func (c *Client) IsClosed() bool
- func (c *Client) IsSubscribed(event string) bool
- func (c *Client) Run(heartbeatInterval time.Duration)
- func (c *Client) SendMessage(msg string) error
- func (c *Client) Subscribe(events ...string)
- func (c *Client) Unsubscribe(events ...string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
ID string // 客户端唯一标识
// contains filtered or unexported fields
}
Client 表示一个SSE客户端连接
func (*Client) IsSubscribed ¶
IsSubscribed 检查是否订阅了指定事件
func (*Client) SendMessage ¶
Click to show internal directories.
Click to hide internal directories.