shareds

package
v1.0.32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

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

func LocalCaches(maxCacheSize uint64) Caches

type Locker

type Locker interface {
	Lock(ctx context.Context) (err error)
	Unlock(ctx context.Context) (err error)
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL