10 const networkTopologyDir string = "topo-network/"
11 const containerTopologyDir string = "topo-containers/"
18 type ActionResult struct {
25 type JsonResult struct {
32 func assertFileSize(f1, f2 string) error {
33 fi1, err := os.Stat(f1)
38 fi2, err1 := os.Stat(f2)
43 if fi1.Size() != fi2.Size() {
44 return fmt.Errorf("file sizes differ (%d vs %d)", fi1.Size(), fi2.Size())
49 func (c *Stanza) newStanza(name string) *Stanza {
50 c.append("\n" + name + " {")
55 func (c *Stanza) append(name string) *Stanza {
56 c.content += strings.Repeat(" ", c.pad)
57 c.content += name + "\n"
61 func (c *Stanza) close() *Stanza {
67 func (s *Stanza) toString() string {
71 func (s *Stanza) saveToFile(fileName string) error {
72 fo, err := os.Create(fileName)
78 _, err = io.Copy(fo, strings.NewReader(s.content))