Documentation
¶
Index ¶
- type Cluster
- type ClusterSpec
- type S
- func (s *S) AutoMigrate() error
- func (s *S) CreateCluster(spec ClusterSpec) (*Cluster, error)
- func (s *S) DeleteCluster(clusterID, tenantID string) error
- func (s *S) GetCluster(clusterID, tenantID string) (*Cluster, error)
- func (s *S) GetClusterByNameAndTenantID(name, tenantID string) (*Cluster, error)
- func (s *S) ListClusters() ([]*Cluster, error)
- func (s *S) ListClustersByTenantID(tenantID string) ([]*Cluster, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { gorm.Model ClusterID string `gorm:"uniqueIndex"` TenantID string `gorm:"uniqueIndex:idx_cluster_tenant_id_name"` Name string `gorm:"uniqueIndex:idx_cluster_tenant_id_name"` RegistrationKey string }
Cluster represents a cluster.
type ClusterSpec ¶
ClusterSpec is a spec of the cluster
type S ¶
type S struct {
// contains filtered or unexported fields
}
S represents the data store.
func (*S) AutoMigrate ¶
AutoMigrate sets up the auto-migration task of the database.
func (*S) CreateCluster ¶
func (s *S) CreateCluster(spec ClusterSpec) (*Cluster, error)
CreateCluster creates a cluster.
func (*S) DeleteCluster ¶
DeleteCluster deletes a cluster by cluster ID and tenant ID.
func (*S) GetCluster ¶
GetCluster returns a cluster by cluster ID and tenant ID.
func (*S) GetClusterByNameAndTenantID ¶ added in v0.3.0
GetClusterByNameAndTenantID returns a cluster by name and tenant ID.
func (*S) ListClusters ¶
ListClusters lists clusters.
Click to show internal directories.
Click to hide internal directories.