mysql

package
v0.0.0-...-26094c9 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const TIMEOUT int64 = 10 * 60

Variables

This section is empty.

Functions

func NewMysqlLeaderElector

func NewMysqlLeaderElector(connect *gorm.DB) component.LeaderElector

Types

type DistributedLock

type DistributedLock struct {
	Id         string `gorm:"primary_key"`
	ExpireTime int64
}

type MysqlLock

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

func NewLock

func NewLock(id string, db *gorm.DB) *MysqlLock

func (*MysqlLock) KeepLock

func (lock *MysqlLock) KeepLock(ctx context.Context)

func (*MysqlLock) TryLock

func (lock *MysqlLock) TryLock() (bool, error)

Jump to

Keyboard shortcuts

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