Documentation ¶
Overview ¶
Package yamlgraph2 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 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 { File *string // yaml graph definition to use; nil if undefined // contains filtered or unexported fields }
GAPI implements the main yamlgraph GAPI interface.
type GraphConfig ¶
type GraphConfig struct { GraphConfigData ResList []resources.Res }
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(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.
func (*GraphConfig) UnmarshalYAML ¶
func (c *GraphConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshalls the complete graph.
type GraphConfigData ¶
type GraphConfigData struct { Graph string `yaml:"graph"` Collector []collectorResConfig `yaml:"collect"` Edges []Edge `yaml:"edges"` Comment string `yaml:"comment"` Remote string `yaml:"remote"` }
GraphConfigData contains the graph data for GraphConfig.
type Resource ¶
type Resource struct { ResourceData // contains filtered or unexported fields }
Resource is the object that unmarshalls resources.
func (*Resource) Decode ¶
Decode is the second stage for unmarshaling of resources (knowing their kind).
func (*Resource) UnmarshalYAML ¶
UnmarshalYAML is the first stage for unmarshaling of resources.
type ResourceData ¶
type ResourceData struct {
Name string `yaml:"name"`
}
ResourceData are the parameters for resource format.