{"modulePath":"github.com/Stackdome/stackdome","version":"v0.0.7-alpha","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package clustermanager\n\n## Types\n\n```go\ntype ClusterControl struct {\n\t// contains filtered or unexported fields\n}\n```\nClusterControl represents a control structure for a single cluster\n\n```go\nfunc (cc *ClusterControl) Serve(ctx context.Context) error\n```\n\n```go\nfunc (cc *ClusterControl) String() string\n```\n\n```go\ntype ClusterManager interface {\n\tRegisterCluster(cluster *models.Cluster) error\n\tGetClient(clusterID string) (client.Client, error)\n\tGetRestConfig(clusterID string) (*rest.Config, error)\n\tIsClusterRegistered(clusterID string) bool\n\tUnregisterCluster(clusterID string) error\n\tReRegisterCluster(cluster *models.Cluster) error\n\tStart(ctx context.Context)\n\tStop(ctx context.Context) error\n\tIsRunning() bool\n}\n```\nClusterManager defines the interface for managing clusters\n\n```go\nfunc NewClusterManager(config ClusterManagerConfig) ClusterManager\n```\nNewClusterManager creates a new ClusterManager instance\n\n```go\ntype ClusterManagerConfig struct {\n\tLeadershipFlag        *leadership.Flag\n\tControllersToRegister []ControllerFn\n\tCredentialDecryptor   CredentialDecryptor\n\tLogger                logger.Logger\n}\n```\nClusterManagerConfig holds configuration for creating a new ClusterManager\n\n```go\ntype ClusterManagerImpl struct {\n\t// contains filtered or unexported fields\n}\n```\nClusterManagerImpl implements the ClusterManager interface\n\n```go\nfunc (cm *ClusterManagerImpl) GetClient(clusterID string) (client.Client, error)\n```\nGetClient retrieves the client for a given cluster\n\n```go\nfunc (cm *ClusterManagerImpl) GetRestConfig(clusterID string) (*rest.Config, error)\n```\nGetRestConfig retrieves the rest config for a given cluster\n\n```go\nfunc (cm *ClusterManagerImpl) IsClusterRegistered(clusterID string) bool\n```\nIsClusterRegistered checks if a cluster is registered\n\n```go\nfunc (cm *ClusterManagerImpl) IsRunning() bool\n```\nIsRunning checks if the cluster manager is currently running\n\n```go\nfunc (cm *ClusterManagerImpl) ReRegisterCluster(cluster *models.Cluster) error\n```\nReRegisterCluster tears down an existing cluster registration and registers it again\n\n```go\nfunc (cm *ClusterManagerImpl) RegisterCluster(cluster *models.Cluster) error\n```\nRegisterCluster registers a new cluster with the manager\n\n```go\nfunc (cm *ClusterManagerImpl) Start(ctx context.Context)\n```\nStart begins the cluster manager operations\n\n```go\nfunc (cm *ClusterManagerImpl) Stop(ctx context.Context) error\n```\nStop halts the cluster manager operations\n\n```go\nfunc (cm *ClusterManagerImpl) UnregisterCluster(clusterID string) error\n```\nUnregisterCluster removes a cluster from the manager\n\n```go\ntype Controller interface {\n\tAddToManager(manager ctrl.Manager) error\n\tName() string\n}\n```\nController defines the interface for controllers that can be added to a manager\n\n```go\ntype ControllerFn func(clusterID string) Controller\n```\n\n```go\ntype CredentialDecryptor interface {\n\tDecryptData(in string) ([]byte, error)\n}\n```\n\n","path":"github.com/Stackdome/stackdome/pkg/clustermanager","name":"clustermanager","synopsis":"","isRedistributable":true}
