dlm

package
v0.0.0-...-c39517e Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DLM

type DLM interface {
	// Lock locks a given name until the expiry duration has passed or Unlock is called
	Lock(name string, expiry time.Duration) error
	// Unlock removes a lock from a given name
	Unlock(name string) (bool, error)
}

DLM Distributed Lock Manager interface

type RedisDLM

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

RedisDLM is a Redis backed implementation of the Distributed Lock Manager interface

func NewRedisDLM

func NewRedisDLM(prefix string, opts *goredislib.Options) *RedisDLM

NewRedisDLM is a helper function for creating a RedisDLM

func (*RedisDLM) Lock

func (r *RedisDLM) Lock(name string, expiry time.Duration) error

Lock locks a given name until the expiry duration has passed or Unlock is called

func (*RedisDLM) Unlock

func (r *RedisDLM) Unlock(name string) (bool, error)

Unlock removes a lock from a given name

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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