summaryrefslogtreecommitdiff
path: root/create.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-22 17:48:10 -0600
committerJeff Carr <[email protected]>2025-02-22 17:48:10 -0600
commit498bfe82f073d5641a42b057512396cc967524c1 (patch)
treee1509616a6e29d496f044a30e7e7039c19e38e5d /create.go
parent6ee6fd8a961057494f82194bd90eeb5ceca4980d (diff)
Diffstat (limited to 'create.go')
-rw-r--r--create.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/create.go b/create.go
index 878a140..71bc2f8 100644
--- a/create.go
+++ b/create.go
@@ -8,7 +8,7 @@ import (
"path/filepath"
"strings"
- pb "go.wit.com/lib/protobuf/virtbuf"
+ "go.wit.com/lib/protobuf/virtpb"
"go.wit.com/log"
"google.golang.org/protobuf/proto"
)
@@ -25,14 +25,14 @@ func createFilename(dir string, filename string) error {
hostname := strings.TrimSuffix(filename, filetype)
log.Info("hostname ==", hostname)
- newDroplet := pb.NewDefaultDroplet(hostname)
- newDisk := new(pb.Disk)
+ newDroplet := virtpb.NewDefaultDroplet(hostname)
+ newDisk := new(virtpb.Disk)
newDisk.Filename = filename
newDisk.Filepath = dir
newDroplet.Disks = append(newDroplet.Disks, newDisk)
- var eth *pb.Network
- eth = new(pb.Network)
+ var eth *virtpb.Network
+ eth = new(virtpb.Network)
eth.Name = "worldbr"
newDroplet.Networks = append(newDroplet.Networks, eth)
@@ -59,7 +59,7 @@ func createFilename(dir string, filename string) error {
}
// send protobuf as wire data
-func postDropletWIRE(url string, d *pb.Droplet) (string, error) {
+func postDropletWIRE(url string, d *virtpb.Droplet) (string, error) {
var bytes []byte
var err error
// Automatically marshal to protobuf binary format
@@ -74,11 +74,11 @@ func postDropletWIRE(url string, d *pb.Droplet) (string, error) {
}
// send protobuf in json format
-func postDropletJSON(url string, d *pb.Droplet) (string, error) {
+func postDropletJSON(url string, d *virtpb.Droplet) (string, error) {
// send protobuf as JSON
bytes, err := d.MarshalJSON()
if err != nil {
- log.Info("virtbuf.MarshalJson() failed:", err)
+ log.Info("virtpb.MarshalJson() failed:", err)
return "", err
}
return post(url, bytes)