redisdb

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0, Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WRITE       = 0
	READ        = 0
	ErrNil      = errors.New("no matching record found in redis database")
	Ctx         = context.TODO()
	Pool        *redis.Pool
	MaxIdle     int
	MaxActive   int
	IdleTimeOut int
	Server      string
)

Functions

func CleanupHook

func CleanupHook()

func Delete

func Delete(key string) error

func Exists

func Exists(key string) (bool, error)

func Get

func Get(key string) ([]byte, error)

func GetKeys

func GetKeys(pattern string) ([]string, error)

func Incr

func Incr(counterKey string) (int, error)

func LockRedis

func LockRedis(client *redislock.Client, ctx context.Context, lock_key string,
	lock_time int) (lock *redislock.Lock, err error)

func NewPool

func NewPool(maxidle int, maxactive int, idletimeout int, server string) *redis.Pool

func Ping

func Ping() error

func RedisClient

func RedisClient(maxidle int, maxactive int, server string) (client *redis9.Client, err error)

func RedisMetric

func RedisMetric()

func RedisServerDelete

func RedisServerDelete(service string, hostname string) error

func RedisServerExists

func RedisServerExists(service string, hostname string) (status bool, err error)

func RedisServiceExists

func RedisServiceExists(service string) (status bool, err error)

func RedisServiceExprieScan

func RedisServiceExprieScan(service string, expire int64) (normalHost []string, expireHost []string,
	alarm bool, err error)

func RedisServiceScan

func RedisServiceScan(service string) (keys []string, err error)

func RedisServiceWrite

func RedisServiceWrite(service string, hostname string) (status bool, err error)

func ReidsServerRead

func ReidsServerRead(service string, hostname string) (value []byte, err error)

func ReleaseLockRedis

func ReleaseLockRedis(lock *redislock.Lock, ctx context.Context)

func Set

func Set(key string, value string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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