Documentation
¶
Index ¶
- type Client
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) Done() <-chan struct{}
- func (c *Conn) ReadMessage() (*jsonrpc.Request, *jsonrpc.Response, error)
- func (c *Conn) SendNotification(method string, params any) error
- func (c *Conn) SendResponse(resp *jsonrpc.Response) error
- func (c *Conn) WriteJSON(v any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Conn *Conn
// contains filtered or unexported fields
}
func NewClientFromConn ¶
func (*Client) OnNotification ¶
func (c *Client) OnNotification(method string, handler app.NotificationHandler)
type Conn ¶
type Conn struct {
WS *websocket.Conn
Logger *zap.Logger
// contains filtered or unexported fields
}
func (*Conn) Close ¶
Close 标记 closed → 等 writeLoop 退出 → 关 underlying WS。 不直接 close(sendQueue),因为其他 goroutine 可能并发 enqueue,会 panic。
func (*Conn) ReadMessage ¶
Click to show internal directories.
Click to hide internal directories.