config

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CONFIG_FILE = "/opt/appdynamics/config/cluster-agent-config.json"

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigManager

type ConfigManager interface {
	Set(*m.AppDBag)
	Get() *m.AppDBag
	Close()
}

Simple interface that allows us to switch out both implementations of the Manager

type ConfigWatcher

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

Watches a file on a set interval, and preforms de-duplication of write events such that only 1 write event is reported even if multiple writes happened during the specified duration.

func WatchFile

func WatchFile(path string, interval time.Duration, action func()) (*ConfigWatcher, error)

Begin watching a file with a specific interval and action

func (*ConfigWatcher) Close

func (self *ConfigWatcher) Close()

type MutexConfigManager

type MutexConfigManager struct {
	Conf               *m.AppDBag
	Mutex              *sync.Mutex
	Watch              *ConfigWatcher
	Logger             *log.Logger
	InstrumentCallback func()
}

This struct manages the configuration instance by preforming locking around access to the Config struct.

func NewMutexConfigManager

func NewMutexConfigManager(env *m.AppDBag, l *log.Logger) *MutexConfigManager

func (*MutexConfigManager) Close

func (self *MutexConfigManager) Close()

func (*MutexConfigManager) Get

func (self *MutexConfigManager) Get() *m.AppDBag

func (*MutexConfigManager) Set

func (self *MutexConfigManager) Set(conf *m.AppDBag)

func (*MutexConfigManager) SubscribeToInstrumentationUpdates added in v0.1.12

func (self *MutexConfigManager) SubscribeToInstrumentationUpdates(callback func())

Jump to

Keyboard shortcuts

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