summaryrefslogtreecommitdiff
path: root/interface.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-07 05:16:16 -0600
committerJeff Carr <[email protected]>2024-11-07 05:16:16 -0600
commitc7e2a62bbb06565b896d0140bd1f7acbe1f9c3d8 (patch)
tree4290ae6bca368e0a03bad53bf251743e454db4fe /interface.go
parentf08a241ebfdd0e029228568eae243a476b6be766 (diff)
rename Clusterv0.22.10
Diffstat (limited to 'interface.go')
-rw-r--r--interface.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/interface.go b/interface.go
index 4573077..a84ea3b 100644
--- a/interface.go
+++ b/interface.go
@@ -18,10 +18,10 @@ type ViewRepoManager struct {
// ViewAPIClient defines the methods required from the API client.
// This is useful if you want to mock this client for testing.
type ViewAPIClient interface {
- GetRepoByName(ctx context.Context, name string) (*virtbuf.NewCluster, error)
+ GetRepoByName(ctx context.Context, name string) (*virtbuf.Cluster, error)
StartRepo(ctx context.Context, clusterID string) error
StopRepo(ctx context.Context, clusterID string) error
- ListRepos(ctx context.Context) ([]*virtbuf.NewCluster, error)
+ ListRepos(ctx context.Context) ([]*virtbuf.Cluster, error)
GetRepoStatus(ctx context.Context, clusterID string) (string, error)
}
@@ -31,7 +31,7 @@ func NewViewRepoManager(client ViewAPIClient) *ViewRepoManager {
}
// FindByName retrieves a cluster by name.
-func (m *ViewRepoManager) FindByName(ctx context.Context, name string) (*virtbuf.NewCluster, error) {
+func (m *ViewRepoManager) FindByName(ctx context.Context, name string) (*virtbuf.Cluster, error) {
cluster, err := m.client.GetRepoByName(ctx, name)
if err != nil {
return nil, fmt.Errorf("error finding cluster by name %q: %w", name, err)
@@ -40,7 +40,7 @@ func (m *ViewRepoManager) FindByName(ctx context.Context, name string) (*virtbuf
}
// Start initiates the startup process for the specified cluster.
-func (m *ViewRepoManager) Start(ctx context.Context, cluster *virtbuf.NewCluster) error {
+func (m *ViewRepoManager) Start(ctx context.Context, cluster *virtbuf.Cluster) error {
if cluster == nil {
return errors.New("cluster cannot be nil")
}
@@ -54,7 +54,7 @@ func (m *ViewRepoManager) Start(ctx context.Context, cluster *virtbuf.NewCluster
}
// Stop halts the specified cluster.
-func (m *ViewRepoManager) Stop(ctx context.Context, cluster *virtbuf.NewCluster) error {
+func (m *ViewRepoManager) Stop(ctx context.Context, cluster *virtbuf.Cluster) error {
if cluster == nil {
return errors.New("cluster cannot be nil")
}
@@ -68,7 +68,7 @@ func (m *ViewRepoManager) Stop(ctx context.Context, cluster *virtbuf.NewCluster)
}
// List retrieves all available clusters.
-func (m *ViewRepoManager) List(ctx context.Context) ([]*virtbuf.NewCluster, error) {
+func (m *ViewRepoManager) List(ctx context.Context) ([]*virtbuf.Cluster, error) {
/*
clusters, err := m.client.ListRepos(ctx)
if err != nil {
@@ -80,7 +80,7 @@ func (m *ViewRepoManager) List(ctx context.Context) ([]*virtbuf.NewCluster, erro
}
// Status checks the current status of a specified cluster.
-func (m *ViewRepoManager) Status(ctx context.Context, cluster *virtbuf.NewCluster) (string, error) {
+func (m *ViewRepoManager) Status(ctx context.Context, cluster *virtbuf.Cluster) (string, error) {
if cluster == nil {
return "", errors.New("cluster cannot be nil")
}