componentcache

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 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 ComponentCache

type ComponentCache interface {
	Add(key, value interface{}) bool
	Get(key interface{}) (component.Component, bool)
	Update(context.Context, UpdateFn) (component.Component, error)
	Start(context.Context)
}

ComponentCache is cache of Components

func NewComponentCache

func NewComponentCache(ctx context.Context) (ComponentCache, error)

NewComponentCache creates a new component cache.

type Event

type Event struct {
	Key       string
	Name      string
	Component component.Component
	Err       error
}

Event holds a Key, Component, and Error and is for writing to the cache.

type UpdateFn

type UpdateFn func(context.Context, chan Event) (string, error)

UpdateFn provides the current context and event channel and should return the key for the component.

Directories

Path Synopsis
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.

Jump to

Keyboard shortcuts

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