lock

package
v0.5.3 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 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BucketKey

func BucketKey(storage, bucket string) key

func MigrationCostsKey

func MigrationCostsKey(fromStorage, toStorage string) key

func MigrationKey

func MigrationKey(fromStorage, toStorage, user string) key

func ObjKey

func ObjKey(storage string, o dom.Object) key

func UpdateOverlap

func UpdateOverlap(m time.Duration)

func UserKey

func UserKey(user string) key

func WithRefresh

func WithRefresh(ctx context.Context, work func() error, refresh func(time.Duration) error, period time.Duration) error

Types

type Opt

type Opt interface {
	// contains filtered or unexported methods
}

func WithDuration

func WithDuration(d time.Duration) Opt

func WithRetry

func WithRetry(retry bool) Opt

type Service

type Service interface {
	Lock(ctx context.Context, key key, opts ...Opt) (release func(), refresh func(time.Duration) error, err error)
}

func New

func New(redisClient *redis.Client) Service

Jump to

Keyboard shortcuts

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