cache

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyEntityStatement            = "entity_statement"
	KeyOPMetadata                 = "op_metadata"
	KeyEntityConfiguration        = "entity_configuration"
	KeyTrustTree                  = "trust_tree"
	KeyTrustTreeChains            = "trust_tree_chains"
	KeyTrustChainResolvedMetadata = "trustchain_resolved_metadata"
	KeySubordinateListing         = "subordinate_listing"
)

Constants for keys for sub caches

Variables

This section is empty.

Functions

func EntityStmtCacheKey

func EntityStmtCacheKey(subID, issID string) string

EntityStmtCacheKey constructs a cache key for an EntityStatementPayload

func Get

func Get(key string, target any) (bool, error)

Get obtains a value for the given key from the cache

func Key

func Key(subsystem, subkey string) string

Key combines a sub system prefix with the key to a cache key

func Set

func Set(key string, value any, duration time.Duration) error

Set caches a value for the given key and duration in the cache

func SetCache

func SetCache(cache Cache)

SetCache sets the Cache that is used

func UseRedisCache

func UseRedisCache(options *redis.Options) error

UseRedisCache creates a new redis cache with the passed options and sets it to be used

Types

type Cache

type Cache interface {
	Get(key string, target any) (bool, error)
	Set(key string, value any, expiration time.Duration) error
}

Cache is an interface for caching data

Jump to

Keyboard shortcuts

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