Documentation
¶
Index ¶
- type AuditLogRepository
- type ClusterRepository
- func (c *ClusterRepository) CreateCluster(ctx context.Context, cluster *model.Cluster) error
- func (c *ClusterRepository) DeleteUpdateCluster(ctx context.Context, cluster *model.Cluster, clusterUUID string) error
- func (c *ClusterRepository) GetClusterByUUID(ctx context.Context, uuid string) (*model.Cluster, error)
- func (c *ClusterRepository) GetClustersByProjectId(ctx context.Context, projectId string) ([]model.Cluster, error)
- func (c *ClusterRepository) UpdateCluster(ctx context.Context, cluster *model.Cluster) error
- type ErrorRepository
- type IAuditLogRepository
- type IClusterRepository
- type IErrorRepository
- type IJobsRepository
- type IKubeconfigRepository
- type INodeGroupsRepository
- type IRepository
- type IResourcesRepository
- type JobsRepository
- func (j *JobsRepository) CreateJob(ctx context.Context, job *model.Job) error
- func (j *JobsRepository) GetJobByIdempotencyKey(ctx context.Context, key string) (*model.Job, error)
- func (j *JobsRepository) GetJobByUUID(ctx context.Context, jobUUID string) (*model.Job, error)
- func (j *JobsRepository) MarkJobFailed(ctx context.Context, jobUUID string, lastErr string, nextRunAt time.Time, ...) error
- func (j *JobsRepository) MarkJobQueued(ctx context.Context, jobUUID string, nextRunAt time.Time) error
- func (j *JobsRepository) MarkJobStarted(ctx context.Context, jobUUID, lockedBy string) error
- func (j *JobsRepository) MarkJobSucceeded(ctx context.Context, jobUUID string) error
- func (j *JobsRepository) RetireIdempotencyKey(ctx context.Context, jobUUID string) error
- type KubeconfigRepository
- func (k *KubeconfigRepository) CreateKubeconfig(ctx context.Context, kubeconfig *model.Kubeconfigs) error
- func (k *KubeconfigRepository) GetKubeconfigByUUID(ctx context.Context, clusterUUID string) (*model.Kubeconfigs, error)
- func (k *KubeconfigRepository) UpdateKubeconfig(ctx context.Context, clusterUUID string, kubeConfig string) error
- type NodeGroupsRepository
- func (n *NodeGroupsRepository) CreateNodeGroups(ctx context.Context, nodeGroups *model.NodeGroups) error
- func (c *NodeGroupsRepository) GetClusterProjectUUIDByNodeGroupUUID(ctx context.Context, nodeGroupUUID string) (string, error)
- func (n *NodeGroupsRepository) GetNodeGroupByUUID(ctx context.Context, uuid string) (*model.NodeGroups, error)
- func (n *NodeGroupsRepository) GetNodeGroupsByClusterUUID(ctx context.Context, uuid, nodeType, nodeGroupStatus string) ([]model.NodeGroups, error)
- func (n *NodeGroupsRepository) UpdateNodeGroups(ctx context.Context, nodeGroups *model.NodeGroups) error
- type ResourcesRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditLogRepository ¶
type AuditLogRepository struct {
// contains filtered or unexported fields
}
func NewAuditLogRepository ¶
func NewAuditLogRepository(mysqlInstance mysqldb.IMysqlInstance) *AuditLogRepository
func (*AuditLogRepository) CreateAuditLog ¶
type ClusterRepository ¶
type ClusterRepository struct {
// contains filtered or unexported fields
}
func NewClusterRepository ¶
func NewClusterRepository(mysqlInstance mysqldb.IMysqlInstance) *ClusterRepository
func (*ClusterRepository) CreateCluster ¶
func (*ClusterRepository) DeleteUpdateCluster ¶
func (*ClusterRepository) GetClusterByUUID ¶
func (*ClusterRepository) GetClustersByProjectId ¶
func (*ClusterRepository) UpdateCluster ¶
type ErrorRepository ¶ added in v1.7.0
type ErrorRepository struct {
// contains filtered or unexported fields
}
func NewErrorRepository ¶ added in v1.7.0
func NewErrorRepository(mysqlInstance mysqldb.IMysqlInstance) *ErrorRepository
func (*ErrorRepository) CreateError ¶ added in v1.7.0
func (*ErrorRepository) GetErrorsByClusterUUID ¶ added in v1.7.0
type IAuditLogRepository ¶
type IClusterRepository ¶
type IClusterRepository interface {
GetClusterByUUID(ctx context.Context, uuid string) (*model.Cluster, error)
GetClustersByProjectId(ctx context.Context, projectId string) ([]model.Cluster, error)
CreateCluster(ctx context.Context, cluster *model.Cluster) error
UpdateCluster(ctx context.Context, cluster *model.Cluster) error
DeleteUpdateCluster(ctx context.Context, cluster *model.Cluster, clusterUUID string) error
}
type IErrorRepository ¶ added in v1.7.0
type IJobsRepository ¶
type IJobsRepository interface {
CreateJob(ctx context.Context, job *model.Job) error
GetJobByIdempotencyKey(ctx context.Context, key string) (*model.Job, error)
GetJobByUUID(ctx context.Context, jobUUID string) (*model.Job, error)
// RetireIdempotencyKey renames idempotency_key so a new job can reuse the same logical key (e.g. after cluster deleted).
RetireIdempotencyKey(ctx context.Context, jobUUID string) error
MarkJobQueued(ctx context.Context, jobUUID string, nextRunAt time.Time) error
MarkJobStarted(ctx context.Context, jobUUID, lockedBy string) error
MarkJobSucceeded(ctx context.Context, jobUUID string) error
MarkJobFailed(ctx context.Context, jobUUID string, lastErr string, nextRunAt time.Time, attempts int) error
}
type IKubeconfigRepository ¶
type INodeGroupsRepository ¶
type INodeGroupsRepository interface {
GetNodeGroupsByClusterUUID(ctx context.Context, uuid, nodeType, nodeGroupStatus string) ([]model.NodeGroups, error)
CreateNodeGroups(ctx context.Context, nodeGroups *model.NodeGroups) error
UpdateNodeGroups(ctx context.Context, nodeGroups *model.NodeGroups) error
GetNodeGroupByUUID(ctx context.Context, uuid string) (*model.NodeGroups, error)
GetClusterProjectUUIDByNodeGroupUUID(ctx context.Context, nodeGroupUUID string) (string, error)
}
type IRepository ¶
type IRepository interface {
Cluster() IClusterRepository
AuditLog() IAuditLogRepository
Kubeconfig() IKubeconfigRepository
NodeGroups() INodeGroupsRepository
Resources() IResourcesRepository
Error() IErrorRepository
Jobs() IJobsRepository
StartDBTransaction(ctx context.Context) (*gorm.DB, error)
CommitDBTransaction(tx *gorm.DB) error
}
func NewRepository ¶
func NewRepository(mi mysqldb.IMysqlInstance, cr IClusterRepository, ar IAuditLogRepository, kr IKubeconfigRepository, ng INodeGroupsRepository, rr IResourcesRepository, er IErrorRepository, jr IJobsRepository) IRepository
type IResourcesRepository ¶ added in v1.7.0
type JobsRepository ¶
type JobsRepository struct {
// contains filtered or unexported fields
}
func NewJobsRepository ¶
func NewJobsRepository(mysqlInstance mysqldb.IMysqlInstance) *JobsRepository
func (*JobsRepository) GetJobByIdempotencyKey ¶
func (*JobsRepository) GetJobByUUID ¶
func (*JobsRepository) MarkJobFailed ¶
func (*JobsRepository) MarkJobQueued ¶
func (*JobsRepository) MarkJobStarted ¶
func (j *JobsRepository) MarkJobStarted(ctx context.Context, jobUUID, lockedBy string) error
func (*JobsRepository) MarkJobSucceeded ¶
func (j *JobsRepository) MarkJobSucceeded(ctx context.Context, jobUUID string) error
func (*JobsRepository) RetireIdempotencyKey ¶
func (j *JobsRepository) RetireIdempotencyKey(ctx context.Context, jobUUID string) error
type KubeconfigRepository ¶
type KubeconfigRepository struct {
// contains filtered or unexported fields
}
func NewKubeconfigRepository ¶
func NewKubeconfigRepository(mysqlInstance mysqldb.IMysqlInstance) *KubeconfigRepository
func (*KubeconfigRepository) CreateKubeconfig ¶
func (k *KubeconfigRepository) CreateKubeconfig(ctx context.Context, kubeconfig *model.Kubeconfigs) error
func (*KubeconfigRepository) GetKubeconfigByUUID ¶
func (k *KubeconfigRepository) GetKubeconfigByUUID(ctx context.Context, clusterUUID string) (*model.Kubeconfigs, error)
func (*KubeconfigRepository) UpdateKubeconfig ¶ added in v1.1.10
type NodeGroupsRepository ¶
type NodeGroupsRepository struct {
// contains filtered or unexported fields
}
func NewNodeGroupsRepository ¶
func NewNodeGroupsRepository(mysqlInstance mysqldb.IMysqlInstance) *NodeGroupsRepository
func (*NodeGroupsRepository) CreateNodeGroups ¶
func (n *NodeGroupsRepository) CreateNodeGroups(ctx context.Context, nodeGroups *model.NodeGroups) error
func (*NodeGroupsRepository) GetClusterProjectUUIDByNodeGroupUUID ¶
func (*NodeGroupsRepository) GetNodeGroupByUUID ¶
func (n *NodeGroupsRepository) GetNodeGroupByUUID(ctx context.Context, uuid string) (*model.NodeGroups, error)
func (*NodeGroupsRepository) GetNodeGroupsByClusterUUID ¶
func (n *NodeGroupsRepository) GetNodeGroupsByClusterUUID(ctx context.Context, uuid, nodeType, nodeGroupStatus string) ([]model.NodeGroups, error)
func (*NodeGroupsRepository) UpdateNodeGroups ¶
func (n *NodeGroupsRepository) UpdateNodeGroups(ctx context.Context, nodeGroups *model.NodeGroups) error
type ResourcesRepository ¶ added in v1.7.0
type ResourcesRepository struct {
// contains filtered or unexported fields
}
func NewResourcesRepository ¶ added in v1.7.0
func NewResourcesRepository(mysqlInstance mysqldb.IMysqlInstance) *ResourcesRepository
func (*ResourcesRepository) CreateResource ¶ added in v1.7.0
func (*ResourcesRepository) GetResourceByClusterUUID ¶ added in v1.7.0
Click to show internal directories.
Click to hide internal directories.