diff options
Diffstat (limited to 'client/client.go')
| -rw-r--r-- | client/client.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/client/client.go b/client/client.go index ba53ec9..a9dfb2d 100644 --- a/client/client.go +++ b/client/client.go @@ -12,6 +12,7 @@ import ( type Handler interface { HandleMessage(msg core.Message) + HandleListItem(list core.ListItem) HandleError(err error) } @@ -110,6 +111,15 @@ func (c *Client) GetHistory(channel string, since time.Time, count, offset int) return core.Send(c.conn, hist) } +func (c *Client) GetList(count, offset int) error { + list := core.List{ + Count: int64(count), + Offset: int64(offset), + } + + return core.Send(c.conn, list) +} + func (c *Client) read() { for { payload, err := core.Read(c.conn) @@ -128,5 +138,7 @@ func (c *Client) handlePayload(payload any) { switch v := payload.(type) { case core.Message: c.h.HandleMessage(v) + case core.ListItem: + c.h.HandleListItem(v) } } |
