Documentation ¶ Overview ¶ 文件锁. Index ¶ type Locker func New(file string) *Locker func (l *Locker) IsLocked() bool func (l *Locker) Lock() func (l *Locker) Path() string func (l *Locker) RLock() func (l *Locker) RUnlock() func (l *Locker) TryLock() bool func (l *Locker) TryRLock() bool func (l *Locker) UnLock() Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Locker ¶ type Locker struct { // contains filtered or unexported fields } 文件锁 func New ¶ func New(file string) *Locker 创建文件锁 func (*Locker) IsLocked ¶ func (l *Locker) IsLocked() bool 当前文件锁是否处于锁定状态(Lock) func (*Locker) Lock ¶ func (l *Locker) Lock() func (*Locker) Path ¶ func (l *Locker) Path() string func (*Locker) RLock ¶ func (l *Locker) RLock() func (*Locker) RUnlock ¶ func (l *Locker) RUnlock() func (*Locker) TryLock ¶ func (l *Locker) TryLock() bool 尝试Lock文件,如果失败立即返回 func (*Locker) TryRLock ¶ func (l *Locker) TryRLock() bool 尝试RLock文件,如果失败立即返回 func (*Locker) UnLock ¶ func (l *Locker) UnLock() Source Files ¶ View all Source files gflock.go Click to show internal directories. Click to hide internal directories.