options

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidName = errors.New("invalid cache name")
)

Functions

This section is empty.

Types

type Lookup

type Lookup map[string]*Options

Lookup is a map of Options

func (Lookup) Initialize

func (l Lookup) Initialize(activeCaches sets.Set[string]) ([]string, error)

Initialize initializes all cache options in the lookup with default values and overlays any values that were set during YAML unmarshaling

func (Lookup) Validate

func (l Lookup) Validate() error

type Options

type Options struct {
	// Name is the Name of the cache, taken from the Key in the Caches map[string]*CacheConfig
	Name string `yaml:"-"`
	// Provider represents the type of cache that we wish to use: "boltdb", "memory", "filesystem", or "redis"
	Provider string `yaml:"provider,omitempty"`
	// Index provides options for the Cache Index
	Index *index.Options `yaml:"index,omitempty"`
	// Redis provides options for Redis caching
	Redis *redis.Options `yaml:"redis,omitempty"`
	// Filesystem provides options for Filesystem caching
	Filesystem *filesystem.Options `yaml:"filesystem,omitempty"`
	// BBolt provides options for BBolt caching
	BBolt *bbolt.Options `yaml:"bbolt,omitempty"`
	// Badger provides options for BadgerDB caching
	Badger *badger.Options `yaml:"badger,omitempty"`
	// Memory provides options for Memory caching
	Memory *memory.Options `yaml:"memory,omitempty"`

	// Defines if the cache should use cache chunking. Splits cache objects into smaller, reliably-sized parts.
	UseCacheChunking bool `yaml:"use_cache_chunking,omitempty"`
	// Determines chunk size (duration) for timeseries objects, query step * chunk factor
	TimeseriesChunkFactor int64 `yaml:"timeseries_chunk_factor"`
	// Determines chunk size (bytes) for byterange objects
	ByterangeChunkSize int64 `yaml:"byterange_chunk_size"`

	// ProviderID represents the internal constant for the provided Provider string
	// and is automatically populated at startup
	ProviderID providers.Provider `yaml:"-"`
}

Options is a collection of defining the Trickster Caching Behavior

func New

func New() *Options

New will return a pointer to a CacheOptions with the default configuration settings

func (*Options) ClearProviderOptions

func (o *Options) ClearProviderOptions()

func (*Options) Clone

func (o *Options) Clone() *Options

Clone returns an exact copy of a *CachingConfig

func (*Options) Equal

func (o *Options) Equal(o2 *Options) bool

Equal returns true if all values in the Options references and their their child Option references are completely identical

func (*Options) Initialize

func (o *Options) Initialize(name string) error

Initialize sets up the cache Options with default values and overlays any values that were set during YAML unmarshaling

func (*Options) UnmarshalYAML

func (o *Options) UnmarshalYAML(unmarshal func(any) error) error

func (*Options) Validate

func (o *Options) Validate() (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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