fileLocker

package
v1.15.7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MasterLocker = "master"
	CliLocker    = "cli"
)

Variables

View Source
var File_common_fileLocker_msg_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type LockMsg

type LockMsg struct {
	Name      string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Timeout   int64  `protobuf:"varint,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
	Local     int64  `protobuf:"varint,3,opt,name=local,proto3" json:"local,omitempty"`
	LocalTime string `protobuf:"bytes,4,opt,name=localTime,proto3" json:"localTime,omitempty"`
	// contains filtered or unexported fields
}

func (*LockMsg) Descriptor deprecated

func (*LockMsg) Descriptor() ([]byte, []int)

Deprecated: Use LockMsg.ProtoReflect.Descriptor instead.

func (*LockMsg) GetLocal

func (x *LockMsg) GetLocal() int64

func (*LockMsg) GetLocalTime

func (x *LockMsg) GetLocalTime() string

func (*LockMsg) GetName

func (x *LockMsg) GetName() string

func (*LockMsg) GetTimeout

func (x *LockMsg) GetTimeout() int64

func (*LockMsg) ProtoMessage

func (*LockMsg) ProtoMessage()

func (*LockMsg) ProtoReflect

func (x *LockMsg) ProtoReflect() protoreflect.Message

func (*LockMsg) Reset

func (x *LockMsg) Reset()

func (*LockMsg) String

func (x *LockMsg) String() string

type Locker

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

func NewLocker

func NewLocker(path string, timeout int, name string) *Locker

func (*Locker) Lock

func (l *Locker) Lock()

func (*Locker) TryLock

func (l *Locker) TryLock() error

TryLock 尝试加锁,加锁失败则返回报错

func (*Locker) Unlock

func (l *Locker) Unlock()

Jump to

Keyboard shortcuts

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