123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- package queue
- import (
- "github.com/robinjoseph08/redisqueue/v2"
- "gogs.baozhida.cn/zoie/OAuth-core/storage"
- )
- 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
- }
|