cache

package
v3.1.0-rc.1.0...-6d180dd Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

func NewProvider(cfg *Config, logger log.Logger) (cache.Provider, error)

NewProvider creates a new cache provider with the given config.

Types

type CacheConfig

type CacheConfig struct {
	Role             []cache.Role      `yaml:"roles"`
	MemcachedConfig  *memcached.Config `yaml:"memcached"`
	RedisConfig      *redis.Config     `yaml:"redis"`
	StoreProbability float64           `yaml:"store_probability"`
}

func (*CacheConfig) Name

func (cfg *CacheConfig) Name() string

Name returns a string representation of the roles claimed by this cache.

func (*CacheConfig) UnmarshalYAML

func (cfg *CacheConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML applies the default while allowing an explicit zero probability.

type Config

type Config struct {
	Background *cache.BackgroundConfig `yaml:"background"`
	Caches     []CacheConfig           `yaml:"caches"`
}

func (*Config) RegisterFlagsAndApplyDefaults

func (cfg *Config) RegisterFlagsAndApplyDefaults(_ string, _ *flag.FlagSet)

func (*Config) Validate

func (cfg *Config) Validate() error

Validate validates the config.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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