memory

package
v0.0.0-...-c349b99 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package memory provides an in-memory volatile config store implementation

Index

Constants

View Source
const (
	// BufferSize specifies the buffer size of event channel
	BufferSize = 10
)

Variables

This section is empty.

Functions

func Make

func Make(descriptor model.ConfigDescriptor) model.ConfigStore

Make creates an in-memory config store from a config descriptor

func NewController

func NewController(cs model.ConfigStore) model.ConfigStoreCache

NewController return an implementation of model.ConfigStoreCache This is a client-side monitor that dispatches events as the changes are being made on the client.

Types

type ConfigEvent

type ConfigEvent struct {
	// contains filtered or unexported fields
}

ConfigEvent defines the event to be processed

type Handler

type Handler func(model.Config, model.Event)

Handler specifies a function to apply on a Config for a given event type

type Monitor

type Monitor interface {
	Run(<-chan struct{})
	AppendEventHandler(string, Handler)
	ScheduleProcessEvent(ConfigEvent)
}

Monitor provides methods of manipulating changes in the config store

func NewConfigStoreMonitor

func NewConfigStoreMonitor(store model.ConfigStore) Monitor

NewConfigStoreMonitor returns new Monitor implementation

Jump to

Keyboard shortcuts

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