rediskit

package
v0.0.0-...-01eaed9 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedisClient

func NewRedisClient(u string) *redis.Client

NewRedisClient parse url like: redis://localhost:6379/0

Types

type RedisLock

type RedisLock struct {
	// contains filtered or unexported fields
}

RedisLock Redis distributed lock

func NewRedisLock

func NewRedisLock(c *redis.Client, key string) *RedisLock

NewRedisLock new a redis lock key - lock name

func (*RedisLock) Lock

func (l *RedisLock) Lock() error

Lock try lock notice: renew every 15 sec

func (*RedisLock) Unlock

func (l *RedisLock) Unlock() error

Unlock unlock check value

Jump to

Keyboard shortcuts

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