config

package
v0.0.0-...-0490640 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	Config interface{}
	// contains filtered or unexported fields
}

Manager - configuration manager for the service

This manager is multiple goroutines safe. Multiple goroutines can use one of these objects, and data updates are performed asynchronously. When an update function is pushed onto a channel, a single goroutine handles the update. When an update occurs the data is written to the config file. Read access is synchronous, where there is some time between seeing updates to the data. This is patterned after Akka's Agents (https://doc.akka.io/docs/akka/2.5.6/java/agents.html)

func NewManager

func NewManager(configFile string, initialConfig interface{}) *Manager

NewManager - create a new config. There should only be one config for the service.

func (*Manager) Close

func (manager *Manager) Close()

Close - to close out the channel for this object. This should only be called when the service is being shutdown

func (*Manager) UpdateConfig

func (manager *Manager) UpdateConfig(updateFunc func(interface{}) (interface{}, error)) error

UpdateConfig - update the config

Jump to

Keyboard shortcuts

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