gconfig

package
v0.0.0-...-9368c7e Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2016 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package gconfig provides the facilities for loading a graph from a yaml file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphConfig

type GraphConfig struct {
	Graph     string `yaml:"graph"`
	Resources struct {
		Noop  []*resources.NoopRes  `yaml:"noop"`
		Pkg   []*resources.PkgRes   `yaml:"pkg"`
		File  []*resources.FileRes  `yaml:"file"`
		Svc   []*resources.SvcRes   `yaml:"svc"`
		Exec  []*resources.ExecRes  `yaml:"exec"`
		Timer []*resources.TimerRes `yaml:"timer"`
		Msg   []*resources.MsgRes   `yaml:"msg"`
	} `yaml:"resources"`
	Collector []collectorResConfig `yaml:"collect"`
	Edges     []edgeConfig         `yaml:"edges"`
	Comment   string               `yaml:"comment"`
	Hostname  string               `yaml:"hostname"` // uuid for the host
	Remote    string               `yaml:"remote"`
}

GraphConfig is the data structure that describes a single graph to run.

func ParseConfigFromFile

func ParseConfigFromFile(filename string) *GraphConfig

ParseConfigFromFile takes a filename and returns the graph config structure.

func (*GraphConfig) NewGraphFromConfig

func (c *GraphConfig) NewGraphFromConfig(g *pgraph.Graph, embdEtcd *etcd.EmbdEtcd, noop bool) (*pgraph.Graph, error)

NewGraphFromConfig returns a new graph from existing input, such as from the existing graph, and a GraphConfig struct.

func (*GraphConfig) Parse

func (c *GraphConfig) Parse(data []byte) error

Parse parses a data stream into the graph structure.

Jump to

Keyboard shortcuts

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