feat: add redis cache and fanout support

This commit is contained in:
richjohnrambo
2026-08-25 20:54:03 +08:00
parent 07376c70e3
commit f900a08a01
68 changed files with 3949 additions and 5696 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ func payloadToData(pl *push.Payload) (map[string]string, error) {
// Must use "xfrom" because "from" is a reserved word. Google did not bother to document it anywhere.
data["xfrom"] = pl.From
if pl.What == push.ActMsg {
data["seq"] = strconv.Itoa(pl.SeqId)
data["seq"] = strconv.FormatInt(pl.SeqId, 10)
if pl.ContentType != "" {
data["mime"] = pl.ContentType
}
@@ -81,7 +81,7 @@ func payloadToData(pl *push.Payload) (map[string]string, error) {
data["modeWant"] = pl.ModeWant.String()
data["modeGiven"] = pl.ModeGiven.String()
} else if pl.What == push.ActRead {
data["seq"] = strconv.Itoa(pl.SeqId)
data["seq"] = strconv.FormatInt(pl.SeqId, 10)
data["silent"] = "true"
} else {
return nil, errors.New("unknown push type")
+1 -1
View File
@@ -76,7 +76,7 @@ type Payload struct {
// Message sender 'usrXXX'
From string `json:"from"`
// Sequential ID of the message.
SeqId int `json:"seq"`
SeqId int64 `json:"seq"`
// MIME-Type of the message content, text/x-drafty or text/plain
ContentType string `json:"mime"`
// Actual Data.Content of the message, if requested