adapter

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound     = errors.New("wracha: not found")
	ErrFailedLock   = errors.New("wracha: failed lock")
	ErrFailedUnlock = errors.New("wracha: failed unlock")
)

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Exists(ctx context.Context, key string) (bool, error)
	Get(ctx context.Context, key string) ([]byte, error)
	Set(ctx context.Context, key string, ttl time.Duration, data []byte) error
	Delete(ctx context.Context, key string) error

	// Deprecated
	Lock(ctx context.Context, key string) error

	// Deprecated
	Unlock(ctx context.Context, key string) error

	ObtainLock(ctx context.Context, key string) (Lock, error)
}

type Lock added in v1.2.0

type Lock interface {
	Release(ctx context.Context) error
}

Directories

Path Synopsis
util

Jump to

Keyboard shortcuts

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