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

12
pkg/locker/interface.go Normal file
View File

@@ -0,0 +1,12 @@
package locker
import (
"context"
"time"
)
type Locker interface {
Lock(ctx context.Context, id string, ttl time.Duration) (bool, error)
Unlock(ctx context.Context, id string) error
WithLock(ctx context.Context, lockKey string, lockTime time.Duration, fn func(context.Context) error) error
}