summaryrefslogtreecommitdiff
path: root/config.go
blob: 808722c9cf3056f4978b93eae4f82c4b00594631 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package zoopb

// functions to import and export the protobuf
// data to and from config files

import (
	"go.wit.com/lib/config"
)

// writes out the cluster information it seperate files
// to make it humanly possible to hand edit things as needed
func (m *Machines) ConfigSave(fullname string) error {
	return config.SavePB(m, fullname)
}

func (m *Machines) ConfigLoad() (string, error) {
	fullname, err := config.LoadPB(m, "/var/lib", "machines")
	if err != nil {
		// log.Info("zoopb.ConfigLoad() failed", err, fullname)
	}
	fullname, err = config.LoadPB(m, "zookeeper", "machines")
	return fullname, err
}