Documentation ¶ Index ¶ type Lock func GetLock(objType string, objID uint) *Lock func (p *Lock) TryLock() bool func (p *Lock) Unlock() Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Lock ¶ type Lock struct { Type string `gorm:"unique_index:idx_lock_tol"` //object type ObjID uint `gorm:"unique_index:idx_lock_tol"` //object id LockID uint `gorm:"unique_index:idx_lock_tol"` //lock id } Lock for mutex func GetLock ¶ func GetLock(objType string, objID uint) *Lock func (*Lock) TryLock ¶ func (p *Lock) TryLock() bool TryLock return true if the lock has been acquired func (*Lock) Unlock ¶ func (p *Lock) Unlock() Unlock release the lock.Do nothing if no lock Source Files ¶ View all Source files lock.go Click to show internal directories. Click to hide internal directories.