repository

package
v1.9.0-beta.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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

func (a *AuditLogRepository) CreateAuditLog(ctx context.Context, auditLog *model.AuditLog) error

type ClusterRepository

type ClusterRepository struct {
	// contains filtered or unexported fields
}

func NewClusterRepository

func NewClusterRepository(mysqlInstance mysqldb.IMysqlInstance) *ClusterRepository

func (*ClusterRepository) CreateCluster

func (c *ClusterRepository) CreateCluster(ctx context.Context, cluster *model.Cluster) error

func (*ClusterRepository) DeleteUpdateCluster

func (c *ClusterRepository) DeleteUpdateCluster(ctx context.Context, cluster *model.Cluster, clusterUUID string) error

func (*ClusterRepository) GetClusterByUUID

func (c *ClusterRepository) GetClusterByUUID(ctx context.Context, uuid string) (*model.Cluster, error)

func (*ClusterRepository) GetClustersByProjectId

func (c *ClusterRepository) GetClustersByProjectId(ctx context.Context, projectId string) ([]model.Cluster, error)

func (*ClusterRepository) UpdateCluster

func (c *ClusterRepository) UpdateCluster(ctx context.Context, cluster *model.Cluster) error

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 (e *ErrorRepository) CreateError(ctx context.Context, err *model.Error) error

func (*ErrorRepository) GetErrorsByClusterUUID added in v1.7.0

func (e *ErrorRepository) GetErrorsByClusterUUID(ctx context.Context, clusterUUID string) ([]model.Error, error)

type IAuditLogRepository

type IAuditLogRepository interface {
	CreateAuditLog(ctx context.Context, auditLog *model.AuditLog) error
}

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 IErrorRepository interface {
	CreateError(ctx context.Context, err *model.Error) error
	GetErrorsByClusterUUID(ctx context.Context, clusterUUID string) ([]model.Error, error)
}

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)
	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 IKubeconfigRepository interface {
	GetKubeconfigByUUID(ctx context.Context, clusterUUID string) (*model.Kubeconfigs, error)
	CreateKubeconfig(ctx context.Context, kubeconfig *model.Kubeconfigs) error
	UpdateKubeconfig(ctx context.Context, clusterUUID string, kubeConfig string) error
}

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
}

type IResourcesRepository added in v1.7.0

type IResourcesRepository interface {
	CreateResource(ctx context.Context, resource *model.Resource) error
	GetResourceByClusterUUID(ctx context.Context, clusterUUID string, resourceType string) ([]model.Resource, error)
}

type JobsRepository

type JobsRepository struct {
	// contains filtered or unexported fields
}

func NewJobsRepository

func NewJobsRepository(mysqlInstance mysqldb.IMysqlInstance) *JobsRepository

func (*JobsRepository) CreateJob

func (j *JobsRepository) CreateJob(ctx context.Context, job *model.Job) error

func (*JobsRepository) GetJobByIdempotencyKey

func (j *JobsRepository) GetJobByIdempotencyKey(ctx context.Context, key string) (*model.Job, error)

func (*JobsRepository) GetJobByUUID

func (j *JobsRepository) GetJobByUUID(ctx context.Context, jobUUID string) (*model.Job, error)

func (*JobsRepository) MarkJobFailed

func (j *JobsRepository) MarkJobFailed(ctx context.Context, jobUUID string, lastErr string, nextRunAt time.Time, attempts int) error

func (*JobsRepository) MarkJobQueued

func (j *JobsRepository) MarkJobQueued(ctx context.Context, jobUUID string, nextRunAt time.Time) error

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

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

func (k *KubeconfigRepository) UpdateKubeconfig(ctx context.Context, clusterUUID string, kubeConfig string) error

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 (c *NodeGroupsRepository) GetClusterProjectUUIDByNodeGroupUUID(ctx context.Context, nodeGroupUUID string) (string, error)

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 (c *ResourcesRepository) CreateResource(ctx context.Context, resource *model.Resource) error

func (*ResourcesRepository) GetResourceByClusterUUID added in v1.7.0

func (c *ResourcesRepository) GetResourceByClusterUUID(ctx context.Context, clusterUUID string, resourceType string) ([]model.Resource, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL