cache

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache added in v0.6.0

type Cache interface {

	// Copy return a copy version of the cache.
	Copy() Cache

	// All return the complete list of the flags.
	All() map[string]flag.Flag

	// Init allow to initialize the cache with a collection of flags.
	Init(flags map[string]dto.DTO)
	// contains filtered or unexported methods
}

Cache is the interface to represent a cache in the system.

type InMemoryCache added in v0.18.4

type InMemoryCache struct {
	Flags  map[string]flag.InternalFlag
	Logger *log.Logger
}

func NewInMemoryCache added in v0.18.4

func NewInMemoryCache(logger *log.Logger) *InMemoryCache

func (*InMemoryCache) All added in v0.18.4

func (fc *InMemoryCache) All() map[string]flag.Flag

func (*InMemoryCache) Copy added in v0.18.4

func (fc *InMemoryCache) Copy() Cache

func (*InMemoryCache) Init added in v0.18.4

func (fc *InMemoryCache) Init(flags map[string]dto.DTO)

type Manager added in v0.18.4

type Manager interface {
	ConvertToFlagStruct(loadedFlags []byte, fileFormat string) (map[string]dto.DTO, error)
	UpdateCache(newFlags map[string]dto.DTO, log *log.Logger) error
	Close()
	GetFlag(key string) (flag.Flag, error)
	AllFlags() (map[string]flag.Flag, error)
	GetLatestUpdateDate() time.Time
}

func New added in v0.6.0

func New(notificationService Service, logger *log.Logger) Manager

type Service added in v0.7.0

type Service interface {
	Close()
	Notify(oldCache map[string]flag.Flag, newCache map[string]flag.Flag, log *log.Logger)
}

func NewNotificationService added in v0.7.0

func NewNotificationService(notifiers []notifier.Notifier) Service

Jump to

Keyboard shortcuts

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