3 Star 3 Fork 1

三三物联网 / ssiot-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
message.go 848 Bytes
一键复制 编辑 原始数据 按行查看 历史
zliu 提交于 2023-03-24 10:03 . 改名ssiot-core、合并msg-sdk
package cache
import (
"gitee.com/sansaniot/ssiot-core/storage"
"github.com/robinjoseph08/redisqueue/v2"
)
type Message struct {
redisqueue.Message
}
func (m *Message) GetID() string {
return m.ID
}
func (m *Message) GetStream() string {
return m.Stream
}
func (m *Message) GetValues() map[string]interface{} {
return m.Values
}
func (m *Message) SetID(id string) {
m.ID = id
}
func (m *Message) SetStream(stream string) {
m.Stream = stream
}
func (m *Message) SetValues(values map[string]interface{}) {
m.Values = values
}
func (m *Message) GetPrefix() (prefix string) {
if m.Values == nil {
return
}
v, _ := m.Values[storage.PrefixKey]
prefix, _ = v.(string)
return
}
func (m *Message) SetPrefix(prefix string) {
if m.Values == nil {
m.Values = make(map[string]interface{})
}
m.Values[storage.PrefixKey] = prefix
}
1
https://gitee.com/sansaniot/ssiot-core.git
git@gitee.com:sansaniot/ssiot-core.git
sansaniot
ssiot-core
ssiot-core
v1.7.7

搜索帮助