cache

package
v0.0.0-...-e75582e Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCaching

func AddCaching(s *session.Session, cacheConfig *Config)

AddCaching adds caching to the Session

func IsCacheHit

func IsCacheHit(ctx context.Context) bool

IsCacheHit returns true if the context was used for a cached API request

Types

type Config

type Config struct {
	DefaultTTL time.Duration
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(defaultTTL time.Duration) *Config

NewConfig returns a cache configuration with the defaultTTL

func (*Config) FlushCache

func (c *Config) FlushCache(serviceName string)

FlushCache flushes all caches for a service

func (*Config) NewCacheCollector

func (c *Config) NewCacheCollector(namespace string) prometheus.Collector

func (*Config) SetCacheTTL

func (c *Config) SetCacheTTL(serviceName, operationName string, ttl time.Duration)

SetCacheTTL sets a unique TTL for the service and operation

Jump to

Keyboard shortcuts

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