cache

package
v0.0.0-...-2198923 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrease

func Decrease(key string, step int64) error

func Delete

func Delete(key string) error

func Expire

func Expire(key string, dur time.Duration) error

func Get

func Get(key string) (any, error)

func Increase

func Increase(key string, step int64) error

func Set

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

func SetDefault

func SetDefault(c contract.CacheHandlerInterface)

Types

type CacheAdapter

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

func Default

func Default() *CacheAdapter

func NewCache

func NewCache(handler contract.CacheHandlerInterface, opts ...OptionFunc) *CacheAdapter

func (*CacheAdapter) Decrease

func (t *CacheAdapter) Decrease(key string, step int64) error

func (*CacheAdapter) Delete

func (t *CacheAdapter) Delete(name string) error

func (*CacheAdapter) Expire

func (t *CacheAdapter) Expire(key string, dur time.Duration) error

func (*CacheAdapter) Get

func (t *CacheAdapter) Get(name string) (any, error)

func (*CacheAdapter) Increase

func (t *CacheAdapter) Increase(key string, step int64) error

func (*CacheAdapter) Set

func (t *CacheAdapter) Set(name string, value any, dur time.Duration) error

type OptionFunc

type OptionFunc func(*CacheAdapter)

func WithPrefix

func WithPrefix(prefix string) OptionFunc

Directories

Path Synopsis
driver

Jump to

Keyboard shortcuts

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