options

package
v2.0.0-beta3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: Apache-2.0 Imports: 12 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) OverlayYAMLData

func (l Lookup) OverlayYAMLData(y yamlx.KeyLookup,
	activeCaches sets.Set[string]) ([]string, error)

OverlayYAMLData extracts supported cache Options values from the yaml map, and overlays the extracted values into activeCaches

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"`

	// 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) Clone

func (c *Options) Clone() *Options

Clone returns an exact copy of a *CachingConfig

func (*Options) Equal

func (c *Options) Equal(c2 *Options) bool

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

func (*Options) Validate

func (c *Options) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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