Documentation ¶
Overview ¶
Package graphjson saves and loads architectures to and from graph json files
Index ¶
- Variables
- func Close()
- func Setup(arch string)
- func Write(str string)
- func WriteDone(name string, t time.Time)
- func WriteEdge(fromTo string, t time.Time)
- func WriteForget(fromTo string, t time.Time)
- func WriteNode(nameService string, t time.Time)
- type DoneV0r4
- type EdgeV0r4
- type ElementV0r4
- type ForgetV0r4
- type GraphV0r4
- type GraphVersion
- type NodeV0r4
Constants ¶
This section is empty.
Variables ¶
var Enabled bool
Enabled is set via command line flags to turn on json logging
Functions ¶
func Setup ¶
func Setup(arch string)
Setup by opening the "arch".json file and writing a header, noting the generated architecture type, version and args for the run
func WriteForget ¶
WriteForget writes the forgotten edge to a file given a space separated edge id, from and to node names
Types ¶
type DoneV0r4 ¶
type DoneV0r4 struct { Done string `json:"done"` Exit string `json:"exit"` Tstamp string `json:"timestamp"` }
DoneV0r4 records a node that goes away, and its exit status. New in 0.4
type EdgeV0r4 ¶
type EdgeV0r4 struct { Edge string `json:"edge"` Source string `json:"source"` Target string `json:"target"` Tstamp string `json:"timestamp,omitempty"` // 0.4 }
EdgeV0r4 defines an edge for version 0.4, used to make json edges for writing
type ElementV0r4 ¶
type ElementV0r4 struct { Node string `json:"node,omitempty"` Package string `json:"package,omitempty"` Service string `json:"service,omitempty"` // name changed from service 0.3 to package 0.4 Edge string `json:"edge,omitempty"` Source string `json:"source,omitempty"` Target string `json:"target,omitempty"` Forget string `json:"forget"` Done string `json:"target,omitempty"` Exit string `json:"exit,omitempty"` Metadata string `json:"metadata,omitempty"` // added to 0.4 Tstamp string `json:"timestamp,omitempty"` }
ElementV0r4 defines a way to read either a node, edge or done in the graph for version 0.3 or 0.4
type ForgetV0r4 ¶
type ForgetV0r4 struct { Forget string `json:"forget"` Source string `json:"source"` Target string `json:"target"` Tstamp string `json:"timestamp"` }
ForgetV0r4 records an edge that has been forgotten and should be removed, forget id should match previous edge id
type GraphV0r4 ¶
type GraphV0r4 struct { Arch string `json:"arch"` Version string `json:"version"` Args string `json:"args"` Date string `json:"date,omitempty"` // 0.4 Graph []ElementV0r4 `json:"graph"` }
GraphV0r4 defines version 0.4 of the graphjson file format with an array of elements
type GraphVersion ¶
type GraphVersion struct {
Version string `json:"version"`
}
GraphVersion extracts the version so it can be checked
type NodeV0r4 ¶
type NodeV0r4 struct { Node string `json:"node"` Package string `json:"package"` // name changed from 0.3 to 0.4 Tstamp string `json:"timestamp,omitempty"` // 0.4 Metadata string `json:"metadata,omitempty"` // added to 0.4 }
NodeV0r4 defines a node for version 0.4, used to make json nodes for writing