| 23 | nextGeneration atomic.Int64 |
| 24 | } |
| 25 | type Lock struct { |
| 26 | Token string |
| 27 | ExpiredAtNs int64 |
| 28 | Key string // only used for moving locks |
| 29 | Owner string |
| 30 | IsBackup bool // true if this node holds the lock as a backup |
| 31 | Generation int64 // monotonic fencing token, increments on fresh acquisition |
| 32 | Seq int64 // per-lock sequence number, increments on every mutation (acquire/renew/unlock) |
| 33 | } |
| 34 | |
| 35 | func NewLockManager() *LockManager { |
| 36 | t := &LockManager{ |
nothing calls this directly
no outgoing calls
no test coverage detected