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 NewCacheController ¶
func NewCacheController(ds storage.OpenFGADatastore, cache storage.InMemoryCache[any], ttl time.Duration, iteratorCacheTTL time.Duration, opts ...InMemoryCacheControllerOpt) CacheController
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{}