cachecontroller

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 17 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.
	// It may return a cached timestamp.
	DetermineInvalidationTime(ctx context.Context, storeID string) time.Time
}

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. It may return a cached timestamp. If the timestamp is not known, it will asynchronously find the last Write and store it, and also invalidate some or all entries in the cache.

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

Jump to

Keyboard shortcuts

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