cfgutil

package
v0.0.0-...-7cb0e1f Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

This pkg is used by the `9volt cfg` portion of the tool

Index

Constants

View Source
const (
	MONITOR_TYPE = "monitor"
	ALERTER_TYPE = "alerter"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CfgUtil

type CfgUtil struct {
	Dir string
}

func New

func New(dir string) (*CfgUtil, error)

Instantiate a new Config client; ensure the given directory exists (and is a directory)

func (*CfgUtil) Fetch

func (c *CfgUtil) Fetch() ([]string, error)

Recursively walk through 'dir', find any .yaml files and verify that they are in fact files containing valid YAML. If they do not contain valid YAML, skip file and display warning.

func (*CfgUtil) Parse

func (c *CfgUtil) Parse(files []string) (*dal.FullConfigs, error)

Roll through the list of YAML files, parsing each for all 'alerter' and 'monitor' sections; parse (and validate) each section, convert it from YAML -> JSON and construct a response with MonitorConfigs and AlerterConfigs.

Structure for MonitorConfigs and AlerterConfigs is a map where the key is the keyname for the config and the vaue is the JSON blob as a byte slice.

type YAMLFileBlob

type YAMLFileBlob map[string]map[string]interface{}

Jump to

Keyboard shortcuts

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