Documentation
¶
Index ¶
- type Cluster
- type Operator
- func (c *Operator) GetAgentDetails(ctx context.Context, clusterID string, projectID string) (Cluster, error)
- func (c *Operator) GetAggregateProjects(ctx context.Context, pipeline mongo.Pipeline, opts *options.AggregateOptions) (*mongo.Cursor, error)
- func (c *Operator) GetCluster(clusterID string) (Cluster, error)
- func (c *Operator) GetClusterWithProjectID(projectID string, clusterType *string) ([]*Cluster, error)
- func (c *Operator) InsertCluster(cluster Cluster) error
- func (c *Operator) ListClusters(ctx context.Context, query bson.D) ([]*Cluster, error)
- func (c *Operator) UpdateCluster(query bson.D, update bson.D) error
- type Toleration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { ClusterID string `bson:"cluster_id"` ProjectID string `bson:"project_id"` ClusterName string `bson:"cluster_name"` Description *string `bson:"description"` PlatformName string `bson:"platform_name"` AgentNamespace *string `bson:"agent_namespace"` Serviceaccount *string `bson:"serviceaccount"` AgentScope string `bson:"agent_scope"` AgentNsExists *bool `bson:"agent_ns_exists"` AgentSaExists *bool `bson:"agent_sa_exists"` AccessKey string `bson:"access_key"` IsRegistered bool `bson:"is_registered"` IsClusterConfirmed bool `bson:"is_cluster_confirmed"` IsActive bool `bson:"is_active"` UpdatedAt string `bson:"updated_at"` CreatedAt string `bson:"created_at"` ClusterType string `bson:"cluster_type"` Token string `bson:"token"` IsRemoved bool `bson:"is_removed"` SkipSSL *bool `bson:"skip_ssl"` NodeSelector *string `bson:"node_selector"` Tolerations []*Toleration `bson:"tolerations,omitempty"` StartTime string `bson:"start_time"` Version string `bson:"version"` }
Cluster contains the required fields to be stored in the database for a cluster
type Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
Operator is the model for cluster collection
func NewClusterOperator ¶
func NewClusterOperator(mongodbOperator mongodb.MongoOperator) *Operator
NewClusterOperator returns a new instance of Operator
func (*Operator) GetAgentDetails ¶
func (c *Operator) GetAgentDetails(ctx context.Context, clusterID string, projectID string) (Cluster, error)
GetAgentDetails takes a agentName and projectID to retrieve the cluster details from the database
func (*Operator) GetAggregateProjects ¶
func (c *Operator) GetAggregateProjects(ctx context.Context, pipeline mongo.Pipeline, opts *options.AggregateOptions) (*mongo.Cursor, error)
GetAggregateProjects takes a mongo pipeline to retrieve the project details from the database
func (*Operator) GetCluster ¶
GetCluster takes a clusterID to retrieve the cluster details from the database
func (*Operator) GetClusterWithProjectID ¶
func (c *Operator) GetClusterWithProjectID(projectID string, clusterType *string) ([]*Cluster, error)
GetClusterWithProjectID takes projectID and clusterType parameters to retrieve the cluster details from the database
func (*Operator) InsertCluster ¶
InsertCluster takes details of a cluster and inserts into the database collection
func (*Operator) ListClusters ¶
ListClusters returns all the clusters matching the query
type Toleration ¶
type Toleration struct { Key *string `bson:"key,omitempty" yaml:"key,omitempty" json:"key,omitempty"` Operator *string `bson:"operator,omitempty" yaml:"operator,omitempty" json:"operator,omitempty"` Effect *string `bson:"effect,omitempty" yaml:"effect,omitempty" json:"effect,omitempty"` Value *string `bson:"value,omitempty" yaml:"value,omitempty" json:"value,omitempty"` TolerationSeconds *int `bson:"toleration_seconds,omitempty" yaml:"tolerationSeconds,omitempty" json:"tolerationSeconds,omitempty"` }