summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addDroplet.go2
-rw-r--r--cloud.go20
-rw-r--r--disks.go8
-rw-r--r--importXML.go8
-rw-r--r--spice.go4
-rw-r--r--start.go4
6 files changed, 23 insertions, 23 deletions
diff --git a/addDroplet.go b/addDroplet.go
index b3085a9..6ca205a 100644
--- a/addDroplet.go
+++ b/addDroplet.go
@@ -8,7 +8,7 @@ import (
"fmt"
"github.com/google/uuid"
- pb "go.wit.com/lib/protobuf/virtbuf"
+ pb "go.wit.com/lib/protobuf/virtpb"
"go.wit.com/log"
"libvirt.org/go/libvirtxml"
)
diff --git a/cloud.go b/cloud.go
index da699fd..89b454b 100644
--- a/cloud.go
+++ b/cloud.go
@@ -12,7 +12,7 @@ import (
"context"
"errors"
- "go.wit.com/lib/protobuf/virtbuf"
+ "go.wit.com/lib/protobuf/virtpb"
)
var ctx context.Context
@@ -22,23 +22,23 @@ var myClient cloudAPI
type CloudManager struct {
// client represents a hypothetical API client for interacting with the cloud.
client cloudAPI
- cluster *virtbuf.Cluster
+ cluster *virtpb.Cluster
}
// cloudAPIt defines the methods required from the API client.
// This is useful if you want to mock this client for testing.
type cloudAPI interface {
- GetDropletByName(name string) *virtbuf.Droplet
+ GetDropletByName(name string) *virtpb.Droplet
StartCluster(clusterID string) error
StopCluster(clusterID string) error
- ListDroplets() ([]*virtbuf.Droplet, error)
+ ListDroplets() ([]*virtpb.Droplet, error)
GetClusterStatus(clusterID string) (string, error)
}
func NewCloud() *CloudManager {
- // client := virtbuf.NewRealCloudAPIClient()
+ // client := virtpb.NewRealCloudAPIClient()
// clusterManager := NewCloudManager(myClient)
newCloudManager := &CloudManager{client: myClient}
@@ -53,7 +53,7 @@ func NewCloud() *CloudManager {
// }
// FindByName retrieves a cluster by name.
-func (m *CloudManager) FindDropletByName(name string) (*virtbuf.Droplet, error) {
+func (m *CloudManager) FindDropletByName(name string) (*virtpb.Droplet, error) {
if m.cluster == nil {
return nil, nil
}
@@ -62,7 +62,7 @@ func (m *CloudManager) FindDropletByName(name string) (*virtbuf.Droplet, error)
}
// Start initiates the startup process for the specified cluster.
-func (m *CloudManager) Start(cluster *virtbuf.Cluster) error {
+func (m *CloudManager) Start(cluster *virtpb.Cluster) error {
if cluster == nil {
return errors.New("cluster cannot be nil")
}
@@ -76,7 +76,7 @@ func (m *CloudManager) Start(cluster *virtbuf.Cluster) error {
}
// Stop halts the specified cluster.
-func (m *CloudManager) Stop(cluster *virtbuf.Cluster) error {
+func (m *CloudManager) Stop(cluster *virtpb.Cluster) error {
if cluster == nil {
return errors.New("cluster cannot be nil")
}
@@ -90,7 +90,7 @@ func (m *CloudManager) Stop(cluster *virtbuf.Cluster) error {
}
// List retrieves all available clusters.
-func (m *CloudManager) List() ([]*virtbuf.Cluster, error) {
+func (m *CloudManager) List() ([]*virtpb.Cluster, error) {
/*
clusters, err := m.client.ListClusters(ctx)
if err != nil {
@@ -102,7 +102,7 @@ func (m *CloudManager) List() ([]*virtbuf.Cluster, error) {
}
// Status checks the current status of a specified cluster.
-func (m *CloudManager) Status(cluster *virtbuf.Cluster) (string, error) {
+func (m *CloudManager) Status(cluster *virtpb.Cluster) (string, error) {
if cluster == nil {
return "", errors.New("cluster cannot be nil")
}
diff --git a/disks.go b/disks.go
index 5956907..c8b9296 100644
--- a/disks.go
+++ b/disks.go
@@ -10,11 +10,11 @@ package virtigolib
import (
"path/filepath"
- pb "go.wit.com/lib/protobuf/virtbuf"
+ "go.wit.com/lib/protobuf/virtpb"
"go.wit.com/log"
)
-func InsertFilename(d *pb.Droplet, filename string) (*pb.Event, error) {
+func InsertFilename(d *virtpb.Droplet, filename string) (*virtpb.Event, error) {
filebase := filepath.Base(filename)
dir := filepath.Dir(filename)
for _, disk := range d.Disks {
@@ -27,8 +27,8 @@ func InsertFilename(d *pb.Droplet, filename string) (*pb.Event, error) {
e := d.NewChangeEvent("Add Disk", "", filename)
// add the disk protobuf entry
- var disk *pb.Disk
- disk = new(pb.Disk)
+ var disk *virtpb.Disk
+ disk = new(virtpb.Disk)
disk.Filename = filebase
disk.Filepath = dir
d.Disks = append(d.Disks, disk)
diff --git a/importXML.go b/importXML.go
index fea2bbb..1b2f0c4 100644
--- a/importXML.go
+++ b/importXML.go
@@ -6,15 +6,15 @@ import (
"errors"
"fmt"
- pb "go.wit.com/lib/protobuf/virtbuf"
+ "go.wit.com/lib/protobuf/virtpb"
"go.wit.com/log"
"libvirt.org/go/libvirtxml"
)
// do a test import of a libvirt xml domain
-func TestLibvirtDomain(domcfg *libvirtxml.Domain) (*pb.Droplet, error) {
- d := new(pb.Droplet)
- d.Current = new(pb.Current)
+func TestLibvirtDomain(domcfg *libvirtxml.Domain) (*virtpb.Droplet, error) {
+ d := new(virtpb.Droplet)
+ d.Current = new(virtpb.Current)
if domcfg == nil {
return d, errors.New("domcfg == nil")
}
diff --git a/spice.go b/spice.go
index 8443539..b426d6d 100644
--- a/spice.go
+++ b/spice.go
@@ -6,11 +6,11 @@ import (
"errors"
"fmt"
- pb "go.wit.com/lib/protobuf/virtbuf"
+ "go.wit.com/lib/protobuf/virtpb"
"libvirt.org/go/libvirtxml"
)
-func SetSpicePort(d *pb.Droplet, domcfg *libvirtxml.Domain) error {
+func SetSpicePort(d *virtpb.Droplet, domcfg *libvirtxml.Domain) error {
if domcfg.Devices.Graphics == nil {
return errors.New("no graphics")
}
diff --git a/start.go b/start.go
index 98a5aa7..883c669 100644
--- a/start.go
+++ b/start.go
@@ -10,12 +10,12 @@ import (
"libvirt.org/go/libvirtxml"
- pb "go.wit.com/lib/protobuf/virtbuf"
+ "go.wit.com/lib/protobuf/virtpb"
"go.wit.com/log"
)
// generate the XML for 'virsh create'
-func GenerateDropletXml(dirs []string, d *pb.Droplet, domcfg *libvirtxml.Domain, hostname string) error {
+func GenerateDropletXml(dirs []string, d *virtpb.Droplet, domcfg *libvirtxml.Domain, hostname string) error {
if d == nil {
return errors.New("*droplet == nil")
}