Documentation ¶
Index ¶
- func AddCaching(s *session.Session, cacheConfig *Config)
- func IsCacheHit(ctx context.Context) bool
- type Config
- func (c *Config) FlushCache(serviceName string)
- func (c *Config) FlushOperationCache(serviceName, operationName string)
- func (c *Config) NewCacheCollector(namespace string) prometheus.Collector
- func (c *Config) SetCacheMutating(serviceName, operationName string, isMutating bool)
- func (c *Config) SetCacheTTL(serviceName, operationName string, ttl time.Duration)
- func (c *Config) SetExcludeFlushing(serviceName, operationName string, isExcluded bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCaching ¶
AddCaching adds caching to the Session
func IsCacheHit ¶
IsCacheHit returns true if the context was used for a cached API request
Types ¶
type Config ¶
type Config struct { DefaultTTL time.Duration BackgroundPruningInterval time.Duration sync.RWMutex // contains filtered or unexported fields }
func NewConfig ¶
func NewConfig(defaultTTL, backgroundPruning time.Duration, maxSize int64, itemsToPrune uint32) *Config
NewConfig returns a cache configuration with the defaultTTL
func (*Config) FlushCache ¶
FlushCache flushes all caches for a service
func (*Config) FlushOperationCache ¶
func (*Config) NewCacheCollector ¶
func (c *Config) NewCacheCollector(namespace string) prometheus.Collector
func (*Config) SetCacheMutating ¶
SetCacheMutating sets a specific operation to mutating/non-mutating
func (*Config) SetCacheTTL ¶
SetCacheTTL sets a unique TTL for the service and operation
func (*Config) SetExcludeFlushing ¶
SetExcludeFlushing sets a specific operation to never flush on mutation, only TTL
Click to show internal directories.
Click to hide internal directories.