mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-20 02:00:49 +00:00
38 lines
737 B
Go
38 lines
737 B
Go
package kv
|
|
|
|
// Commands
|
|
const (
|
|
CmdReadKey = "kget"
|
|
CmdWriteKey = "kset"
|
|
CmdSubscribeKey = "ksub"
|
|
CmdUnsubscribeKey = "kunsub"
|
|
)
|
|
|
|
type wsRequest struct {
|
|
CmdName string `json:"command"`
|
|
Data map[string]interface{} `json:"data"`
|
|
}
|
|
|
|
type wsError struct {
|
|
Error string `json:"error"`
|
|
}
|
|
|
|
type wsGenericResponse struct {
|
|
CmdType string `json:"type"`
|
|
Ok bool `json:"ok"`
|
|
Cmd string `json:"cmd"`
|
|
Data interface{} `json:"data"`
|
|
}
|
|
|
|
type wsEmptyResponse struct {
|
|
CmdType string `json:"type"`
|
|
Ok bool `json:"ok"`
|
|
Cmd string `json:"cmd"`
|
|
}
|
|
|
|
type wsPush struct {
|
|
CmdType string `json:"type"`
|
|
Key string `json:"key"`
|
|
NewValue string `json:"new_value"`
|
|
}
|