memory

package
v0.0.0-...-1a56975 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 5 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 = 100
)

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 NewBufferedMonitor

func NewBufferedMonitor(store model.ConfigStore, bufferSize int) Monitor

NewBufferedMonitor returns new Monitor implementation with the specified event buffer size

func NewMonitor

func NewMonitor(store model.ConfigStore) Monitor

NewMonitor returns new Monitor implementation with a default event buffer size.

Jump to

Keyboard shortcuts

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