Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package websocket
import (
"context"
"sync"
"gfx.cafe/open/jrpc"
"nhooyr.io/websocket"
)
type Client struct {
conn *websocket.Conn
reconnectFunc reconnectFunc
mu sync.RWMutex
}
type reconnectFunc func(ctx context.Context) (*websocket.Conn, error)
func newClient(initctx context.Context, connect reconnectFunc) (*Client, error) {
conn, err := connect(initctx)
if err != nil {
return nil, err
}
c := &Client{}
c.conn = conn
c.reconnectFunc = connect
return c, nil
}
func (c *Client) Do(ctx context.Context, result any, method string, params any) error {
panic("not implemented") // TODO: Implement
}
func (c *Client) BatchCall(ctx context.Context, b ...jrpc.BatchElem) error {
panic("not implemented") // TODO: Implement
}
func (c *Client) SetHeader(key string, value string) {
panic("not implemented") // TODO: Implement
}
func (c *Client) Close() error {
panic("not implemented") // TODO: Implement
}
func (c *Client) Notify(ctx context.Context, method string, args ...any) error {
panic("not implemented") // TODO: Implement
}
func (c *Client) Subscribe(ctx context.Context, namespace string, channel any, args ...any) (*jrpc.ClientSubscription, error) {
panic("not implemented") // TODO: Implement
}