Help us shape the future of Go! Take the 2026 Go Developer Survey

locker

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locker

type Locker struct {
	Namespace string
	Redis     *redis.Client
}

func New added in v0.0.7

func New(options ...Option) *Locker

func (*Locker) Delete

func (x *Locker) Delete(ctx context.Context, name string) error

func (*Locker) Key

func (x *Locker) Key(name string) string

func (*Locker) Update

func (x *Locker) Update(ctx context.Context, name string, ttl time.Duration) (err error)

func (*Locker) Verify

func (x *Locker) Verify(ctx context.Context, name string, n int64) (result bool, err error)

type Option added in v0.0.7

type Option func(x *Locker)

func SetNamespace added in v0.0.7

func SetNamespace(v string) Option

func SetRedis added in v0.0.7

func SetRedis(v *redis.Client) Option

Jump to

Keyboard shortcuts

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