rds

package
v1.8.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoElements = errors.New("no elements got from the backend")

ErrNoElements is a pre defined error to describe the case that no elements got from the backend database.

Functions

func AcquireLock

func AcquireLock(conn redis.Conn, lockerKey string, lockerID string, expireTime int64) error

AcquireLock acquires a redis lock with specified expired time

func HmGet

func HmGet(conn redis.Conn, key string, fields ...interface{}) ([]interface{}, error)

HmGet gets values of multiple fields Values have same order with the provided fields

func HmSet

func HmSet(conn redis.Conn, key string, fieldAndValues ...interface{}) error

HmSet sets the properties of hash map

func KeyHookEventRetryQueue

func KeyHookEventRetryQueue(namespace string) string

KeyHookEventRetryQueue returns the key of hook event retrying queue

func KeyJobStats

func KeyJobStats(namespace string, jobID string) string

KeyJobStats returns the key of job stats

func KeyNamespacePrefix

func KeyNamespacePrefix(namespace string) string

KeyNamespacePrefix returns the based key based on the namespace.

func KeyPeriod

func KeyPeriod(namespace string) string

KeyPeriod returns the key of period

func KeyPeriodicLock

func KeyPeriodicLock(namespace string) string

KeyPeriodicLock returns the key of locker under period

func KeyPeriodicNotification

func KeyPeriodicNotification(namespace string) string

KeyPeriodicNotification returns the key of periodic pub/sub channel.

func KeyPeriodicPolicy

func KeyPeriodicPolicy(namespace string) string

KeyPeriodicPolicy returns the key of periodic policies.

func KeyStatusUpdateRetryQueue

func KeyStatusUpdateRetryQueue(namespace string) string

KeyStatusUpdateRetryQueue returns the key of status change retrying queue

func KeyUpstreamJobAndExecutions

func KeyUpstreamJobAndExecutions(namespace, upstreamJobID string) string

KeyUpstreamJobAndExecutions returns the key for persisting executions.

func RedisKeyLastPeriodicEnqueue

func RedisKeyLastPeriodicEnqueue(namespace string) string

RedisKeyLastPeriodicEnqueue returns key of timestamp if last periodic enqueue.

func RedisKeyScheduled

func RedisKeyScheduled(namespace string) string

RedisKeyScheduled returns key of scheduled job.

func RedisNamespacePrefix

func RedisNamespacePrefix(namespace string) string

RedisNamespacePrefix ... Same with 'KeyNamespacePrefix', only for compatibility.

func ReleaseLock

func ReleaseLock(conn redis.Conn, lockerKey string, lockerID string) error

ReleaseLock releases the acquired lock

func ZPopMin

func ZPopMin(conn redis.Conn, key string) (interface{}, error)

ZPopMin pops the element with lowest score in the zset

Types

type JobScore

type JobScore struct {
	JobBytes []byte
	Score    int64
}

JobScore represents the data item with score in the redis db.

func GetZsetByScore

func GetZsetByScore(conn redis.Conn, key string, scores []int64) ([]JobScore, error)

GetZsetByScore get the items from the zset filtered by the specified score scope.

Jump to

Keyboard shortcuts

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