Documentation ¶
Index ¶
- type NoResultTx
- type NoResultsCache
- func (c *NoResultsCache[T]) Get(dataset, workspace string, customVals, states []string, parameters []T) bool
- func (c *NoResultsCache[T]) Invalidate(dataset, workspace string, customVals, states []string, parameters []T)
- func (c *NoResultsCache[T]) InvalidateDataset(dataset string)
- func (c *NoResultsCache[T]) StartNoResultTx(dataset, workspace string, customVals, states []string, parameters []T) (tx *NoResultTx[T])
- func (c *NoResultsCache[T]) String() string
- type ParameterFilter
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.