cache

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoResultTx

type NoResultTx[T ParameterFilter] struct {
	// contains filtered or unexported fields
}

NoResultTx is a transaction for the NoResultsCache.

func (*NoResultTx[T]) Commit

func (tx *NoResultTx[T]) Commit()

Commit sets the necessary cache entries for the relevant dataset, workspace, states, customVals and parameters filters.

type NoResultsCache

type NoResultsCache[T ParameterFilter] struct {
	// contains filtered or unexported fields
}

func NewNoResultsCache

func NewNoResultsCache[T ParameterFilter](supportedParams []string, ttlFn func() time.Duration) *NoResultsCache[T]

NewNoResultsCache creates a new, properly initialised NoResultsCache.

func (*NoResultsCache[T]) Get

func (c *NoResultsCache[T]) Get(dataset, workspace string, customVals, states []string, parameters []T) bool

Get returns true if the cache contains a valid entry for the provided dataset, workspace, customVals, states and parameters filters.

func (*NoResultsCache[T]) Invalidate

func (c *NoResultsCache[T]) Invalidate(dataset, workspace string, customVals, states []string, parameters []T)

Invalidate invalidates all cache entries for the provided dataset, workspace, customVals, states and parameters.

func (*NoResultsCache[T]) InvalidateDataset

func (c *NoResultsCache[T]) InvalidateDataset(dataset string)

InvalidateDataset invalidates all cache entries for a given dataset.

func (*NoResultsCache[T]) StartNoResultTx

func (c *NoResultsCache[T]) StartNoResultTx(dataset, workspace string, customVals, states []string, parameters []T) (tx *NoResultTx[T])

StartNoResultTx prepares the cache for accepting new no result entries. The cache uses a special marker to prevent synchronisation issues between competing calls of Invalidate & SetNoResult.

func (*NoResultsCache[T]) String

func (c *NoResultsCache[T]) String() string

String returns a string representation of the cache's tree contents.

type ParameterFilter

type ParameterFilter interface {
	GetName() string
	GetValue() string
}

Jump to

Keyboard shortcuts

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