11 lines
179 B
Go
11 lines
179 B
Go
|
package lock
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
type Locker interface {
|
||
|
WithLock(ctx context.Context, key string, timeout time.Duration, fn func(ctx context.Context) error) error
|
||
|
}
|