cache

package
v4.25.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDBStore added in v4.19.7

func NewDBStore(db func() *gorm.DB) contracts.Store

func NewMetricsForCache

func NewMetricsForCache(c contracts.CacheInterface) contracts.CacheInterface

NewMetricsForCache impl contracts.CacheInterface

Types

type Cache

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

func (*Cache) Clear

func (c *Cache) Clear(key contracts.CacheKeyInterface) error

Clear TODO

func (*Cache) Remember

func (c *Cache) Remember(key contracts.CacheKeyInterface, seconds int, fn func() ([]byte, error)) ([]byte, error)

Remember TODO

func (*Cache) SetWithTTL

func (c *Cache) SetWithTTL(key contracts.CacheKeyInterface, value []byte, seconds int) error

SetWithTTL TODO

func (*Cache) Store added in v4.19.7

func (c *Cache) Store() contracts.Store

Store TODO

type Key

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

func NewKey

func NewKey(slug string, vals ...any) *Key

NewKey impl contracts.CacheKeyInterface

func (*Key) Slug

func (c *Key) Slug() string

Slug key slug: key-1 => key, key-2 => key

func (*Key) String

func (c *Key) String() string

String key string: key-1, key-2

type MetricsForCache

type MetricsForCache struct {
	Cache contracts.CacheInterface
}

func (*MetricsForCache) Clear

Clear TODO.

func (*MetricsForCache) Remember

func (m *MetricsForCache) Remember(key contracts.CacheKeyInterface, seconds int, fn func() ([]byte, error)) ([]byte, error)

Remember TODO.

func (*MetricsForCache) SetWithTTL

func (m *MetricsForCache) SetWithTTL(key contracts.CacheKeyInterface, value []byte, seconds int) error

SetWithTTL TODO.

func (*MetricsForCache) Store added in v4.19.7

func (m *MetricsForCache) Store() contracts.Store

Store TODO.

type NoCache

type NoCache struct{}

func (*NoCache) Clear

func (n *NoCache) Clear(key contracts.CacheKeyInterface) error

Clear TODO.

func (*NoCache) Remember

func (n *NoCache) Remember(key contracts.CacheKeyInterface, seconds int, fn func() ([]byte, error)) ([]byte, error)

Remember TODO.

func (*NoCache) SetWithTTL

func (n *NoCache) SetWithTTL(key contracts.CacheKeyInterface, value []byte, seconds int) error

SetWithTTL TODO.

func (*NoCache) Store added in v4.19.7

func (n *NoCache) Store() contracts.Store

Store TODO.

Jump to

Keyboard shortcuts

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