cache

package
v0.2.22 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Checksum() string
	Class() string
	Delete(ctx context.Context, key string) error
	Get(ctx context.Context, key string) (value string, exists bool, isCurrent bool, err error)
	Host() string
	Set(ctx context.Context, key string, value string) error
	TTL() time.Duration
	Uncycled() bool
}

type CacheManager

type CacheManager interface {
	Cycle(checksum string, force bool) error
	GetCache(class string, opts CacheOptions) Cache
}

func NewCacheManager

func NewCacheManager(addr, host string, ttl *time.Duration) (CacheManager, error)

type CacheOptions

type CacheOptions struct {
	TTL      *time.Duration
	Uncycled bool
}

type InMemoryCache

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

func (*InMemoryCache) Checksum added in v0.2.7

func (c *InMemoryCache) Checksum() string

func (*InMemoryCache) Class

func (c *InMemoryCache) Class() string

func (*InMemoryCache) Delete

func (c *InMemoryCache) Delete(ctx context.Context, key string) error

func (*InMemoryCache) Get

func (c *InMemoryCache) Get(ctx context.Context, key string) (string, bool, bool, error)

func (*InMemoryCache) Host

func (c *InMemoryCache) Host() string

func (*InMemoryCache) Set

func (c *InMemoryCache) Set(ctx context.Context, key string, value string) error

Set stores a rendered page in the cache.

func (*InMemoryCache) TTL

func (c *InMemoryCache) TTL() time.Duration

func (*InMemoryCache) Uncycled

func (c *InMemoryCache) Uncycled() bool

type InMemoryCacheManager

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

func (*InMemoryCacheManager) Cycle

func (m *InMemoryCacheManager) Cycle(checksum string, force bool) error

func (*InMemoryCacheManager) GetCache

func (m *InMemoryCacheManager) GetCache(class string, opts CacheOptions) Cache

type ValkeyCache

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

func (*ValkeyCache) Checksum added in v0.2.7

func (s *ValkeyCache) Checksum() string

func (*ValkeyCache) Class

func (s *ValkeyCache) Class() string

func (*ValkeyCache) Delete

func (s *ValkeyCache) Delete(ctx context.Context, key string) error

func (*ValkeyCache) Get

func (s *ValkeyCache) Get(ctx context.Context, key string) (string, bool, bool, error)

func (*ValkeyCache) Host

func (s *ValkeyCache) Host() string

func (*ValkeyCache) Set

func (s *ValkeyCache) Set(ctx context.Context, key string, value string) error

func (*ValkeyCache) TTL

func (s *ValkeyCache) TTL() time.Duration

func (*ValkeyCache) Uncycled

func (s *ValkeyCache) Uncycled() bool

type ValkeyCacheManager

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

func (*ValkeyCacheManager) Cycle

func (m *ValkeyCacheManager) Cycle(checksum string, force bool) error

func (*ValkeyCacheManager) GetCache

func (m *ValkeyCacheManager) GetCache(class string, opts CacheOptions) Cache

Jump to

Keyboard shortcuts

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