dlocker

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

分布式锁 基于mysql数据库

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lock

func Lock(method string, checkRate int64) (guid string, err error)

func Renewal

func Renewal(guid string)

func SetCheckRate

func SetCheckRate(rate int64)

func UnLock

func UnLock(method string) error

Types

type Locker

type Locker struct {
	sync.Mutex `json:"-" xorm:"-" gorm:"-"`
	Guid       string `json:"guid" xorm:"unique"`
	Method     string `json:"method" xorm:"unique"`
	CreatedAt  int64  `json:"created_at" xorm:"created"`
}

func (Locker) TableName

func (Locker) TableName() string

Jump to

Keyboard shortcuts

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