Documentation ¶
Overview ¶
Index ¶
- Variables
- type FieldEntry
- type MessageEntry
- type RediStore
- func (s *RediStore) Close() error
- func (s *RediStore) Delete(key string) error
- func (s *RediStore) Do(cmd string, args ...interface{}) (interface{}, error)
- func (s *RediStore) Lock(key, owner string, age time.Duration) error
- func (s *RediStore) PutJSON(key string, val interface{}, age time.Duration) error
- func (s *RediStore) ScanJSON(key string, val interface{}) error
- func (s *RediStore) ScanKey(cursor int64, pattern string, limit int) (int64, [][]byte, error)
- func (s *RediStore) TryLock(key, owner string, age time.Duration) error
- func (s *RediStore) Unlock(key, owner string) error
- func (s *RediStore) XACK(streamName, groupName, entryId string) (int, error)
- func (s *RediStore) XAdd(streamName string, key string, val interface{}, kv ...interface{}) (string, error)
- func (s *RediStore) XClaim(streamName, groupName, entryId, toConsumerName string, ...) error
- func (s *RediStore) XCreateGroup(streamName, groupName string) error
- func (s *RediStore) XDel(streamName, msgId string, otherIds ...interface{}) (int, error)
- func (s *RediStore) XDeleteGroupUser(streamName, groupName, consumerName string) error
- func (s *RediStore) XDestroyGroup(streamName, groupName string) error
- func (s *RediStore) XLen(streamName string) (int, error)
- func (s *RediStore) XPending(streamName, groupName string, limit int64) ([]interface{}, error)
- func (s *RediStore) XReadGroup(streamName, groupName, consumerName string, limit int, timeout time.Duration) ([]StreamEntry, error)
- func (s *RediStore) XTrim(streamName string, maxLen int) (int, error)
- type StreamEntry
Constants ¶
This section is empty.
Variables ¶
var ( ErrNil = redis.ErrNil ErrDataExist = errors.New("Data already exist") )
var (
ErrLocked = errors.New("Another client has locked")
)
Functions ¶
This section is empty.
Types ¶
type FieldEntry ¶
func FieldEntries ¶
func FieldEntries(replay interface{}, err error) ([]FieldEntry, error)
type MessageEntry ¶
type MessageEntry struct { ID string Fields []FieldEntry }
func MessageEntries ¶
func MessageEntries(reply interface{}, err error) ([]MessageEntry, error)
Need the replay is a message entry format.
type RediStore ¶
RediStore stores sessions in a redis backend.
func NewRediStore ¶
NewRediStore returns a new RediStore. size: maximum number of idle connections.
func NewRediStoreWithDB ¶
NewRediStoreWithDB - like NewRedisStore but accepts `DB` parameter to select redis DB instead of using the default one ("0")
func NewRediStoreWithPool ¶
NewRediStoreWithPool instantiates a RediStore with a *redis.Pool passed in.
func (*RediStore) PutJSON ¶
save stores the session in redis. store data with json format age -- 0 for no expired.
func (*RediStore) XAdd ¶
func (s *RediStore) XAdd(streamName string, key string, val interface{}, kv ...interface{}) (string, error)
for stream xadd return the system id
func (*RediStore) XClaim ¶
func (s *RediStore) XClaim(streamName, groupName, entryId, toConsumerName string, overDuration time.Duration) error
transfer the timeout task to another consumer. XAUTOCLAIM Available since 6.2.0.
func (*RediStore) XCreateGroup ¶
TODO: confirm the MKSTREAM in which versoin
func (*RediStore) XDeleteGroupUser ¶
func (*RediStore) XDestroyGroup ¶
func (*RediStore) XPending ¶
get the pending task. Since version 6.2 it is possible to filter entries by their idle-time,
func (*RediStore) XReadGroup ¶
func (s *RediStore) XReadGroup(streamName, groupName, consumerName string, limit int, timeout time.Duration) ([]StreamEntry, error)
for multi-consumer the group name is set as the stream name Need create first before using.
type StreamEntry ¶
type StreamEntry struct { StreamName string Messages []MessageEntry }
func StreamEntries ¶
func StreamEntries(reply interface{}, err error) ([]StreamEntry, error)