mutex

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

@Title @Description @Author Wangwengang 2024/1/8 13:09 @Update Wangwengang 2024/1/8 13:09

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdMutex

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

func NewEtcdLeaseMutex

func NewEtcdLeaseMutex(key string, client *clientv3.Client, ttl int64) (*EtcdMutex, error)

NewEtcdLeaseMutex ttl

func NewEtcdMutex

func NewEtcdMutex(client *clientv3.Client) (*EtcdMutex, error)

NewEtcdMutex default 10s

func (*EtcdMutex) Close

func (em *EtcdMutex) Close()

func (*EtcdMutex) Lock

func (em *EtcdMutex) Lock(key string) error

Lock get lock

func (*EtcdMutex) Unlock

func (em *EtcdMutex) Unlock(key string) error

Jump to

Keyboard shortcuts

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