diff options
Diffstat (limited to 'cloud.go')
| -rw-r--r-- | cloud.go | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -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") } |
