utils

package
v0.0.0-...-8c1e015 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOG_PREFIX   = "[reloader]"
	PROCESS_NAME = "telegraf"
)

Variables

This section is empty.

Functions

func RemoveConfigFile

func RemoveConfigFile(path string)

func WriteConfigFile

func WriteConfigFile(path string, contents string)

Types

type Dict

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

a kv-tree to hold values for the template

func NewDict

func NewDict() *Dict

Create new Dict

func (*Dict) Child

func (d *Dict) Child(key string) *Dict

retrieve or create child at key

func (*Dict) Del

func (d *Dict) Del(key string)

delete value or child at key

func (*Dict) Get

func (d *Dict) Get(key string) (string, bool)

func (*Dict) GetOrDefault

func (d *Dict) GetOrDefault(key string, def string) string

func (*Dict) HasChild

func (d *Dict) HasChild(key string) bool

check if child exists

func (*Dict) HasValue

func (d *Dict) HasValue(key string) bool

check if value exists

func (*Dict) PathGet

func (d *Dict) PathGet(path string) (string, bool)

traverse the dictionary and look for a specific value at the path end

func (*Dict) PathGetOrDefault

func (d *Dict) PathGetOrDefault(path string, def string) string

traverse the dictionary and look for a specific value at the path end

func (*Dict) Set

func (d *Dict) Set(key string, value string)

type TelegrafReloader

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

func NewTelegrafReloader

func NewTelegrafReloader() *TelegrafReloader

Create new config and populate it from environment

func (*TelegrafReloader) IsReloadRequested

func (tr *TelegrafReloader) IsReloadRequested() bool

func (*TelegrafReloader) Reload

func (tr *TelegrafReloader) Reload()

func (*TelegrafReloader) ReloadIfRequested

func (tr *TelegrafReloader) ReloadIfRequested()

func (*TelegrafReloader) RequestReload

func (tr *TelegrafReloader) RequestReload()

Jump to

Keyboard shortcuts

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