cachecontroller

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheController

type CacheController interface {
	// DetermineInvalidationTime returns the timestamp of the last write for the specified store if it was in cache,
	// Else it returns Zero time and triggers InvalidateIfNeeded().
	DetermineInvalidationTime(context.Context, string) time.Time

	// InvalidateIfNeeded checks to see if an invalidation is currently in progress for a store,
	// and if not it will spawn a goroutine to invalidate cached records conditionally
	// based on timestamp. It may invalidate all cache records, some, or none.
	InvalidateIfNeeded(context.Context, string)
}

func NewNoopCacheController

func NewNoopCacheController() CacheController

type InMemoryCacheController

type InMemoryCacheController struct {
	// contains filtered or unexported fields
}

InMemoryCacheController will invalidate cache iterator (InMemoryCache) and sub problem cache (CachedCheckResolver) entries that are more recent than the last write for the specified store. Note that the invalidation is done asynchronously, and only after a Check request is received. It will be eventually consistent.

func (*InMemoryCacheController) DetermineInvalidationTime added in v1.8.5

func (c *InMemoryCacheController) DetermineInvalidationTime(
	ctx context.Context,
	storeID string,
) time.Time

DetermineInvalidationTime returns the timestamp of the last write for the specified store if it was in cache, Else it returns Zero time and triggers InvalidateIfNeeded().

func (*InMemoryCacheController) InvalidateIfNeeded added in v1.8.10

func (c *InMemoryCacheController) InvalidateIfNeeded(ctx context.Context, storeID string)

type InMemoryCacheControllerOpt added in v1.8.5

type InMemoryCacheControllerOpt func(*InMemoryCacheController)

InMemoryCacheControllerOpt defines an option that can be used to change the behavior of InMemoryCacheController instance.

func WithLogger added in v1.8.5

func WithLogger(logger logger.Logger) InMemoryCacheControllerOpt

WithLogger sets the logger for InMemoryCacheController.

type NoopCacheController

type NoopCacheController struct{}

func (*NoopCacheController) DetermineInvalidationTime added in v1.8.5

func (c *NoopCacheController) DetermineInvalidationTime(_ context.Context, _ string) time.Time

func (*NoopCacheController) InvalidateIfNeeded added in v1.8.10

func (c *NoopCacheController) InvalidateIfNeeded(_ context.Context, _ string)

Jump to

Keyboard shortcuts

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