diff options
| author | Jeff Carr <[email protected]> | 2025-02-22 17:46:07 -0600 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-22 17:46:07 -0600 | 
| commit | cf708182ac53757918c9f71e85d9865b42cf7d35 (patch) | |
| tree | 70bed918d6b0ebf2bbbe51436f70f7a52414ae16 | |
| parent | 72af75ceaaeda83ef430aa2f790d332d6086bf66 (diff) | |
| -rw-r--r-- | addDroplet.go | 2 | ||||
| -rw-r--r-- | cloud.go | 20 | ||||
| -rw-r--r-- | disks.go | 8 | ||||
| -rw-r--r-- | importXML.go | 8 | ||||
| -rw-r--r-- | spice.go | 4 | ||||
| -rw-r--r-- | start.go | 4 | 
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"  ) @@ -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")  	} @@ -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")  	} @@ -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")  	} @@ -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")  	}  | 
