initial commit

This commit is contained in:
m.zare
2026-04-10 18:25:21 +03:30
commit 77ca6c34a3
263 changed files with 34470 additions and 0 deletions

21
pkg/locker/errors.go Normal file
View File

@@ -0,0 +1,21 @@
package locker
import "fmt"
type LockErr struct {
id string
maxRetries uint32
err error
}
func NewLockError(id string, maxRetries uint32, acquireErr error) LockErr {
if acquireErr != nil {
return LockErr{id: id, maxRetries: maxRetries, err: acquireErr}
}
return LockErr{id, maxRetries, fmt.Errorf("failed to acquire lock after %d retries", maxRetries)}
}
func (l LockErr) Error() string {
return l.err.Error()
}