Add streaming list support.
This commit is contained in:
parent
6f05c48bf6
commit
3e2bdc63c7
|
@ -156,3 +156,11 @@ func (c *Client) StreamingHashtag(ctx context.Context, tag string, isLocal bool)
|
|||
|
||||
return c.streaming(ctx, p, params)
|
||||
}
|
||||
|
||||
// StreamingList return channel to read events on a list.
|
||||
func (c *Client) StreamingList(ctx context.Context, id ID) (chan Event, error) {
|
||||
params := url.Values{}
|
||||
params.Set("list", string(id))
|
||||
|
||||
return c.streaming(ctx, "list", params)
|
||||
}
|
||||
|
|
|
@ -51,6 +51,11 @@ func (c *WSClient) StreamingWSHashtag(ctx context.Context, tag string, isLocal b
|
|||
return c.streamingWS(ctx, s, tag)
|
||||
}
|
||||
|
||||
// StreamingWSList return channel to read events on a list using WebSocket.
|
||||
func (c *WSClient) StreamingWSList(ctx context.Context, id ID) (chan Event, error) {
|
||||
return c.streamingWS(ctx, "list", string(id))
|
||||
}
|
||||
|
||||
func (c *WSClient) streamingWS(ctx context.Context, stream, tag string) (chan Event, error) {
|
||||
params := url.Values{}
|
||||
params.Set("access_token", c.client.config.AccessToken)
|
||||
|
|
Loading…
Reference in New Issue
Block a user