cache

package
v1.4.17 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCacheNotFound = errors.New("juice: cache not found")

ErrCacheNotFound is the error that cache not found.

Functions

This section is empty.

Types

type ScopeCache added in v1.4.9

type ScopeCache interface {
	// Set sets the value for the key.
	Set(ctx context.Context, key string, value any) error

	// Get gets the value for the key.
	// If the value does not exist, it should return ErrCacheNotFound.
	Get(ctx context.Context, key string) (any, error)

	// Flush flushes all the cache.
	// It will be called after Commit() or Rollback().
	Flush(ctx context.Context) error
}

ScopeCache is an interface for transactional cache.

func InMemoryScopeCache added in v1.4.9

func InMemoryScopeCache() ScopeCache

InMemoryScopeCache returns an ScopeCache instance.

Jump to

Keyboard shortcuts

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