summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorbt <bt@rctt.net>2026-05-16 19:15:21 +0200
committerbt <bt@rctt.net>2026-05-16 22:46:48 +0200
commit82902e9dc3ad67c49e4f9381b83d38a659efa083 (patch)
treee53faaa5231eb6624fea4e4c448709d7a8765d37 /client
parentc04c73a4df223c8c2b2b42ed482fc0181948e6ea (diff)
downloadsolec-82902e9dc3ad67c49e4f9381b83d38a659efa083.tar.gz
solec-82902e9dc3ad67c49e4f9381b83d38a659efa083.zip
Add history reading
Diffstat (limited to 'client')
-rw-r--r--client/client.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/client/client.go b/client/client.go
index 775fbb6..b07bc27 100644
--- a/client/client.go
+++ b/client/client.go
@@ -4,6 +4,7 @@ import (
"errors"
"io"
"net"
+ "time"
"go.rctt.net/solec/core"
)
@@ -83,6 +84,17 @@ func (c *Client) Leave(channel string) error {
return core.Send(c.conn, umod)
}
+func (c *Client) GetHistory(channel string, since time.Time, count, offset int) error {
+ hist := core.History{
+ Channel: channel,
+ Since: since,
+ Count: int64(count),
+ Offset: int64(offset),
+ }
+
+ return core.Send(c.conn, hist)
+}
+
func (c *Client) read() {
for {
payload, err := core.Read(c.conn)