summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/daemon/main.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/cmd/daemon/main.go b/cmd/daemon/main.go
index 242a45a..10fb61c 100644
--- a/cmd/daemon/main.go
+++ b/cmd/daemon/main.go
@@ -9,6 +9,7 @@ import (
"os"
"slices"
"strings"
+ "time"
"go.rctt.net/solec/server"
"go.rctt.net/solec/storage"
@@ -19,6 +20,7 @@ import (
var (
cmds = map[string]func(args []string){
"broadcast": sendBroadcast,
+ "read": readHistory,
"exit": exit,
}
serv *server.Server
@@ -74,6 +76,20 @@ func sendBroadcast(args []string) {
serv.SendBroadcast(msg)
}
+func readHistory(args []string) {
+ if len(args) != 1 {
+ fmt.Println("usage: read <channel>")
+ }
+
+ hist, err := serv.Storage.Read(args[0], time.Time{}, 999999, 0)
+ if err != nil {
+ fmt.Println(err)
+ return
+ }
+
+ fmt.Println(hist)
+}
+
func exit(args []string) {
os.Exit(0)
}