cacheservice

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCacheType = errors.New("invalid cache type")
	ErrCacheTypeEmpty   = errors.New("CACHE_TYPE environment variable is not set")
)

Sentinel errors for cache validation.

Functions

func GetCachedDB

func GetCachedDB() int

GetCachedDB get cache db.

func GetChacheExpired

func GetChacheExpired() int

GetChacheExpired get cache expired.

func GetSessionDB

func GetSessionDB() int

GetSessionDB get session db.

Types

type CacheAssessor

type CacheAssessor struct {
	// contains filtered or unexported fields
}

CacheAssessor struct.

func NewCacheAssessor deprecated

func NewCacheAssessor(db int) *CacheAssessor

NewCacheAssessor creates a new CacheAssessor.

Deprecated: Use NewCacheAssessorWithConfig for better error handling.

func NewCacheAssessorWithConfig added in v1.10.4

func NewCacheAssessorWithConfig(ctx context.Context, db int) (*CacheAssessor, error)

NewCacheAssessorWithConfig creates a new CacheAssessor with proper error handling.

func (*CacheAssessor) Delete

func (ca *CacheAssessor) Delete(ctx context.Context, index string) error

Delete remove cache contents.

func (*CacheAssessor) Get

func (ca *CacheAssessor) Get(ctx context.Context, index string) (any, bool, error)

Get returns cache contents.

func (*CacheAssessor) Set

func (ca *CacheAssessor) Set(ctx context.Context, index string, value any, expired int) error

Set puts cache contents.

Jump to

Keyboard shortcuts

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