dlocker

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const TypeNode = "dlocker"

Variables

This section is empty.

Functions

func Deregister

func Deregister(name string)

Deregister 清理配置适配器

func NewBuilder

func NewBuilder() container.StandardBuilder

func Register

func Register(resolver xResover)

RegisterCache 注册配置文件适配器

Types

type DLocker

type DLocker interface {
	//expire 秒
	Acquire(ctx context.Context, expire int) (bool, error)
	Release(ctx context.Context) (bool, error)
	//expire 秒
	Renewal(ctx context.Context, expire int) error
}

type DLockerBuilder

type DLockerBuilder interface {
	Build(key string, opts ...Option) DLocker
}

type Option

type Option func(opts *Options)

func WithAutoRenewal added in v0.5.6

func WithAutoRenewal() Option

自动续期

func WithData added in v0.4.0

func WithData(data string) Option

设置数据

type Options added in v0.4.0

type Options struct {
	Data        string
	AutoRenewal bool
}

type StandardLocker

type StandardLocker interface {
	GetDLocker() (q DLockerBuilder)
}

StandardLocker cache

func NewStandardLocker

func NewStandardLocker(c container.Container) StandardLocker

NewStandardLocker 创建 lock

Jump to

Keyboard shortcuts

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