Skip to content

Commit

Permalink
fix(cluster-svc): introduce interface defining functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
karol-kokoszka committed Apr 18, 2024
1 parent 1634cd1 commit 80775bd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/service/cluster/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ type Change struct {
WithoutRepair bool
}

// Servicer interface defines the responsibilities of the cluster service.
// It's a duplicate of the restapi.ClusterService, but I want to avoid doing bigger refactor
// and removing the interface from restapi package (although nothing prevents us from doing so).
type Servicer interface {
ListClusters(ctx context.Context, f *Filter) ([]*Cluster, error)
GetCluster(ctx context.Context, idOrName string) (*Cluster, error)
PutCluster(ctx context.Context, c *Cluster) error
DeleteCluster(ctx context.Context, id uuid.UUID) error
CheckCQLCredentials(id uuid.UUID) (bool, error)
DeleteCQLCredentials(ctx context.Context, id uuid.UUID) error
DeleteSSLUserCert(ctx context.Context, id uuid.UUID) error
ListNodes(ctx context.Context, id uuid.UUID) ([]Node, error)
}

// Service manages cluster configurations.
type Service struct {
session gocqlx.Session
Expand Down

0 comments on commit 80775bd

Please sign in to comment.