Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrLockTimeout = fmt.Errorf("lockers: lock timeout")
)
Functions ¶
This section is empty.
Types ¶
type Caches ¶ added in v1.0.21
type Caches interface { Get(ctx context.Context, key []byte) (value []byte, has bool) Exist(ctx context.Context, key []byte) (has bool) Set(ctx context.Context, key []byte, value []byte, ttl time.Duration) (ok bool) Remove(ctx context.Context, key []byte) }
func LocalCaches ¶ added in v1.0.21
type Lockers ¶
type Lockers interface {
Acquire(ctx context.Context, key []byte, ttl time.Duration) (locker Locker, err error)
}
func LocalLockers ¶
func LocalLockers() Lockers
type Store ¶
type Store interface { Get(ctx context.Context, key []byte) (value []byte, has bool, err errors.CodeError) Set(ctx context.Context, key []byte, value []byte) (err errors.CodeError) SetWithTTL(ctx context.Context, key []byte, value []byte, ttl time.Duration) (err errors.CodeError) Incr(ctx context.Context, key []byte, delta int64) (v int64, err errors.CodeError) ExpireKey(ctx context.Context, key []byte, ttl time.Duration) (err errors.CodeError) Remove(ctx context.Context, key []byte) (err errors.CodeError) Close() }
func LocalStore ¶
func LocalStore() (store Store)
Click to show internal directories.
Click to hide internal directories.