Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListCICDProviders ¶
func ListCICDProviders() []string
ListCICDProviders 列出所有已注册的 CICD Provider 名称
func RegisterCICD ¶
func RegisterCICD(name string, provider CICDProvider)
RegisterCICD 注册一个 CICD Provider
Types ¶
type CICDProvider ¶
type CICDProvider interface {
// GetName 返回提供商名称 (如: jenkins, gitlab-ci)
GetName() string
// Initialize 初始化客户端
Initialize(config map[string]any) error
// ListJobs 列出所有任务
ListJobs(ctx context.Context, opts *QueryOptions) ([]*model.Job, error)
// GetJob 获取任务详情
GetJob(ctx context.Context, jobName string) (*model.Job, error)
// GetJobBuilds 获取任务的构建历史
GetJobBuilds(ctx context.Context, jobName string, limit int) ([]*model.Build, error)
// HealthCheck 健康检查
HealthCheck(ctx context.Context) error
}
CICDProvider 定义 CI/CD 工具的统一接口
func GetCICDProvider ¶
func GetCICDProvider(name string) (CICDProvider, error)
GetCICDProvider 获取指定名称的 CICD Provider
type Provider ¶
type Provider interface {
// GetName 返回提供商名称 (如: aliyun, tencent, aws)
GetName() string
// Initialize 初始化提供商客户端
Initialize(config map[string]any) error
// ListInstances 列出所有实例 (ECS/CVM/EC2)
ListInstances(ctx context.Context, opts *QueryOptions) ([]*model.Instance, error)
// GetInstance 获取单个实例详情
GetInstance(ctx context.Context, instanceID string) (*model.Instance, error)
// ListDatabases 列出数据库实例
ListDatabases(ctx context.Context, opts *QueryOptions) ([]*model.Database, error)
// GetDatabase 获取数据库详情
GetDatabase(ctx context.Context, dbID string) (*model.Database, error)
// ListOSSBuckets 列出对象存储桶
ListOSSBuckets(ctx context.Context, opts *QueryOptions) ([]*model.OSSBucket, error)
// GetOSSBucket 获取对象存储桶详情
GetOSSBucket(ctx context.Context, bucketName string) (*model.OSSBucket, error)
// HealthCheck 健康检查
HealthCheck(ctx context.Context) error
}
Provider 定义了云服务提供商的统一接口
Click to show internal directories.
Click to hide internal directories.