zoopb/config.go

24 lines
613 B
Go

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
}