Documentation ¶
Overview ¶
Package yamlgraph provides the facilities for loading a graph from a yaml file.
Index ¶
Constants ¶
const ( // Name is the name of this frontend. Name = "yaml" // Start is the entry point filename that we use. It is arbitrary. Start = "/start.yaml" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Edge ¶
type Edge struct { Name string `yaml:"name"` From Vertex `yaml:"from"` To Vertex `yaml:"to"` Notify bool `yaml:"notify"` }
Edge is the data structure of an edge.
type GAPI ¶
type GAPI struct { InputURI string // input URI of file system containing yaml graph to use // contains filtered or unexported fields }
GAPI implements the main yamlgraph GAPI interface.
func (*GAPI) Cli ¶
Cli takes a cli.Context, and returns our GAPI if activated. All arguments should take the prefix of the registered name. On activation, if there are any validation problems, you should return an error. If this was not activated, then you should return a nil GAPI and a nil error.
type GraphConfig ¶
type GraphConfig struct { Graph string `yaml:"graph"` Resources Resources `yaml:"resources"` Collector []collectorResConfig `yaml:"collect"` Edges []Edge `yaml:"edges"` Comment string `yaml:"comment"` Remote string `yaml:"remote"` }
GraphConfig is the data structure that describes a single graph to run.
func ParseConfigFromFile ¶
func ParseConfigFromFile(data []byte) *GraphConfig
ParseConfigFromFile takes a filename and returns the graph config structure.
func (*GraphConfig) NewGraphFromConfig ¶
func (c *GraphConfig) NewGraphFromConfig(hostname string, world resources.World, noop bool) (*pgraph.Graph, error)
NewGraphFromConfig transforms a GraphConfig struct into a new graph. FIXME: remove any possibly left over, now obsolete graph diff code from here!
func (*GraphConfig) Parse ¶
func (c *GraphConfig) Parse(data []byte) error
Parse parses a data stream into the graph structure.
type Resources ¶
type Resources struct { // in alphabetical order Augeas []*resources.AugeasRes `yaml:"augeas"` AwsEc2 []*resources.AwsEc2Res `yaml:"aws:ec2"` Exec []*resources.ExecRes `yaml:"exec"` File []*resources.FileRes `yaml:"file"` Graph []*resources.GraphRes `yaml:"graph"` Group []*resources.GroupRes `yaml:"group"` Hostname []*resources.HostnameRes `yaml:"hostname"` KV []*resources.KVRes `yaml:"kv"` Msg []*resources.MsgRes `yaml:"msg"` Noop []*resources.NoopRes `yaml:"noop"` Nspawn []*resources.NspawnRes `yaml:"nspawn"` Password []*resources.PasswordRes `yaml:"password"` Pkg []*resources.PkgRes `yaml:"pkg"` Print []*resources.PrintRes `yaml:"print"` Svc []*resources.SvcRes `yaml:"svc"` Test []*resources.TestRes `yaml:"test"` Timer []*resources.TimerRes `yaml:"timer"` User []*resources.UserRes `yaml:"user"` Virt []*resources.VirtRes `yaml:"virt"` }
Resources is the data structure of the set of resources.