forgepb/patch.Send.go

28 lines
621 B
Go

package forgepb
// functions to import and export the protobuf
// data to and from config files
import (
"errors"
"time"
"go.wit.com/log"
)
func (f *Forge) SendPatchSet(pset *Patchs) error {
var err error
data, err := pset.Marshal()
if err != nil {
log.Info("proto.Marshal() pset(len) error", len(data), err)
return err
}
now := time.Now()
timestamp := now.Format("2006.01.02.150405") // bummer. other date doesn't work?
cfgfile := "patchset/patchset." + timestamp + ".pb"
log.Info("proto.Marshal() pset(len)", len(data))
configWrite(cfgfile, data)
return errors.New("don't know how to send yet")
}