| 1 | package iface |
| 2 | |
| 3 | type Lock interface { |
| 4 | //Acquire the lock with retry |
| 5 | //key: the name of the lock, |
| 6 | //value: at the nanosecond timestamp that lock needs to be released automatically |
| 7 | LockWithRetries(key string, value int64) error |
| 8 | |
| 9 | //Acquire the lock with once |
| 10 | //key: the name of the lock, |
| 11 | //value: at the nanosecond timestamp that lock needs to be released automatically |
| 12 | Lock(key string, value int64) error |
| 13 | } |