gmredis

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2023 License: MulanPSL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Redis Stream 是 Redis 5.0 版本新增加的数据结构。

Index

Constants

View Source
const ErrorTimeOut = "timeout"

Variables

This section is empty.

Functions

This section is empty.

Types

type BPopPushRsp

type BPopPushRsp struct {
	ListName string
	Value    string
}

type Handle

type Handle struct {
	Key    keyStorage
	Str    strStorage
	Set    setStorage
	List   listStorage
	Stream streamStorage
	Lock   Lock
	PubSub pubsubStorage
}

func Get

func Get() *Handle

func New

func New() *Handle

func (*Handle) SetTimeOut

func (c *Handle) SetTimeOut(n int)

type Lock

type Lock struct {
}

func (*Lock) LockWithTimeout

func (c *Lock) LockWithTimeout(key string, lockTime, waitTime int) (string, bool)

LockWithTimeout 设置分布式 lockTime 锁设置的ttl时间 ; waitTime 等待时间

func (*Lock) ReleaseLock

func (c *Lock) ReleaseLock(key, id string) error

ReleaseLock 释放锁 id LockWithTimeout 返回的记录,用于比较存储中的一致性

type StreamData

type StreamData struct {
	ID    string                 `json:"id"`
	Value map[string]interface{} `json:"value"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL