cache

package
v0.0.0-...-be244c0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(key string) string
	Put(key string, value string) error
	IsEmpty() bool
	Initialize() error
}

Cache interface for a string to string cache

func NewAutoRefreshCache

func NewAutoRefreshCache(
	extSource ServiceAliasMappingExternalSource,
	storage ServiceAliasMappingStorage,
	logger *zap.Logger,
	readRefreshInterval, saveRefreshInterval time.Duration,
) Cache

NewAutoRefreshCache returns an autoRefreshCache

type ServiceAliasMappingExternalSource

type ServiceAliasMappingExternalSource interface {
	Load() (map[string]string, error)
}

ServiceAliasMappingExternalSource interface to load service alias mapping from an external source

type ServiceAliasMappingStorage

type ServiceAliasMappingStorage interface {
	Load() (map[string]string, error)
	Save(data map[string]string) error
}

ServiceAliasMappingStorage interface for reading/writing service alias mapping from/to storage.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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