lock

package
v0.0.0-...-cb472e6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CreateModelFormat create model user format
	CreateModelFormat = "coreservice:create:model:%s"

	// CreateModuleAttrFormat create model  attribute format
	CreateModuleAttrFormat = "coreservice:create:model:%s:attr:%s"

	// CheckSetTemplateSyncFormat  检测集群模板同步的状态
	CheckSetTemplateSyncFormat = "topo:settemplate:sync:status:check:%d"
)

not duplicate allow

Variables

This section is empty.

Functions

This section is empty.

Types

type Locker

type Locker interface {
	// Lock can lock one
	Lock(key StrFormat, expire time.Duration) (looked bool, err error)
	Unlock() error
}

Locker redis atomic lock

func NewLocker

func NewLocker(cache *redis.Client) Locker

type StrFormat

type StrFormat string

StrFormat build lock key format

func GetLockKey

func GetLockKey(format StrFormat, params ...interface{}) StrFormat

GetLockKey build lock key

Jump to

Keyboard shortcuts

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