Documentation ¶
Index ¶
- Constants
- func CancelScanningTask(userName, scanningID string, taskID int64, typeString config.PipelineType, ...) error
- func ConvertToDBScanningModule(args *Scanning) *commonmodels.Scanning
- func CreateScanningModule(username string, args *Scanning, log *zap.SugaredLogger) error
- func CreateScanningTask(id string, req []*ScanningRepoInfo, notificationID, username string, ...) (int64, error)
- func CreateTesting(username string, testing *commonmodels.Testing, log *zap.SugaredLogger) error
- func DeleteScanningModuleByID(id string, log *zap.SugaredLogger) error
- func GetHTMLTestReport(pipelineName, pipelineType, taskIDStr, testName string, log *zap.SugaredLogger) (string, error)
- func GetRaw(name, productName string, log *zap.SugaredLogger) (*commonmodels.Testing, error)
- func GetTestLocalTestSuite(serviceName string, log *zap.SugaredLogger) (*commonmodels.TestSuite, error)
- func GetTestTask(testName string) (*commonmodels.TestTaskStat, error)
- func GetTesting(name, productName string, log *zap.SugaredLogger) (*commonmodels.Testing, error)
- func GetWorkflowV4HTMLTestReport(workflowName, jobName string, taskID int64, log *zap.SugaredLogger) (string, error)
- func HandleCronjob(testing *commonmodels.Testing, log *zap.SugaredLogger) error
- func ListAllWorkflows(testName string, log *zap.SugaredLogger) ([]*commonmodels.Workflow, error)
- func ListCronjob(name, jobType string) ([]*commonmodels.Cronjob, error)
- func ListTestStat(log *zap.SugaredLogger) ([]*commonmodels.TestTaskStat, error)
- func OpenAPICreateScanningModule(username string, args *OpenAPICreateScanningReq, log *zap.SugaredLogger) error
- func UpdateScanningModule(id, username string, args *Scanning, log *zap.SugaredLogger) error
- func UpdateTesting(username string, testing *commonmodels.Testing, log *zap.SugaredLogger) error
- type CreateTaskResp
- type GetTestArtifactInfoResp
- type ListScanningRespItem
- type ListScanningTaskResp
- type OpenAPICreateScanningReq
- type Scanning
- type ScanningInfo
- type ScanningRepoInfo
- type ScanningStatistic
- type ScanningTaskDetail
- type ScanningTaskResp
- type TestingDetail
- type TestingOpt
Constants ¶
View Source
const ( PERPAGE = 100 PAGE = 1 )
View Source
const DefaultScanningTimeout = 60 * 60
Variables ¶
This section is empty.
Functions ¶
func CancelScanningTask ¶ added in v1.9.9
func CancelScanningTask(userName, scanningID string, taskID int64, typeString config.PipelineType, requestID string, log *zap.SugaredLogger) error
func ConvertToDBScanningModule ¶ added in v1.9.9
func ConvertToDBScanningModule(args *Scanning) *commonmodels.Scanning
func CreateScanningModule ¶ added in v1.9.9
func CreateScanningModule(username string, args *Scanning, log *zap.SugaredLogger) error
func CreateScanningTask ¶ added in v1.9.9
func CreateScanningTask(id string, req []*ScanningRepoInfo, notificationID, username string, log *zap.SugaredLogger) (int64, error)
CreateScanningTask uses notificationID if the task is triggered by webhook, otherwise it should be empty
func CreateTesting ¶ added in v1.2.0
func CreateTesting(username string, testing *commonmodels.Testing, log *zap.SugaredLogger) error
func DeleteScanningModuleByID ¶ added in v1.9.9
func DeleteScanningModuleByID(id string, log *zap.SugaredLogger) error
func GetHTMLTestReport ¶ added in v1.2.0
func GetHTMLTestReport(pipelineName, pipelineType, taskIDStr, testName string, log *zap.SugaredLogger) (string, error)
func GetRaw ¶
func GetRaw(name, productName string, log *zap.SugaredLogger) (*commonmodels.Testing, error)
GetRaw find the testing module with secret env not masked
func GetTestLocalTestSuite ¶
func GetTestLocalTestSuite(serviceName string, log *zap.SugaredLogger) (*commonmodels.TestSuite, error)
func GetTestTask ¶
func GetTestTask(testName string) (*commonmodels.TestTaskStat, error)
func GetTesting ¶ added in v1.2.0
func GetTesting(name, productName string, log *zap.SugaredLogger) (*commonmodels.Testing, error)
func GetWorkflowV4HTMLTestReport ¶ added in v1.9.9
func HandleCronjob ¶
func HandleCronjob(testing *commonmodels.Testing, log *zap.SugaredLogger) error
func ListAllWorkflows ¶
func ListAllWorkflows(testName string, log *zap.SugaredLogger) ([]*commonmodels.Workflow, error)
func ListCronjob ¶
func ListCronjob(name, jobType string) ([]*commonmodels.Cronjob, error)
func ListTestStat ¶ added in v1.2.0
func ListTestStat(log *zap.SugaredLogger) ([]*commonmodels.TestTaskStat, error)
func OpenAPICreateScanningModule ¶ added in v1.9.9
func OpenAPICreateScanningModule(username string, args *OpenAPICreateScanningReq, log *zap.SugaredLogger) error
func UpdateScanningModule ¶ added in v1.9.9
func UpdateScanningModule(id, username string, args *Scanning, log *zap.SugaredLogger) error
func UpdateTesting ¶ added in v1.2.0
func UpdateTesting(username string, testing *commonmodels.Testing, log *zap.SugaredLogger) error
Types ¶
type CreateTaskResp ¶
type CreateTaskResp struct { PipelineName string `json:"pipeline_name"` TaskID int64 `json:"task_id"` }
func CreateTestTask ¶
func CreateTestTask(args *commonmodels.TestTaskArgs, log *zap.SugaredLogger) (*CreateTaskResp, error)
type GetTestArtifactInfoResp ¶ added in v1.9.9
type GetTestArtifactInfoResp struct { FileNames []string `json:"file_names"` NotHistoryFileFlag bool `json:"not_history_file_flag"` }
func GetTestArtifactInfo ¶
func GetTestArtifactInfo(pipelineName, dir string, taskID int64, log *zap.SugaredLogger) (*GetTestArtifactInfoResp, error)
func GetWorkflowV4TestArtifactInfo ¶ added in v1.9.9
func GetWorkflowV4TestArtifactInfo(workflowName, jobName string, taskID int64, log *zap.SugaredLogger) (*GetTestArtifactInfoResp, error)
type ListScanningRespItem ¶ added in v1.9.9
type ListScanningRespItem struct { ID string `json:"id"` Name string `json:"name"` Statistics *ScanningStatistic `json:"statistics"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` Repos []*types.Repository `json:"repos"` ClusterID string `json:"cluster_id"` }
func ListScanningModule ¶ added in v1.9.9
func ListScanningModule(projectName string, log *zap.SugaredLogger) ([]*ListScanningRespItem, int64, error)
type ListScanningTaskResp ¶ added in v1.9.9
type ListScanningTaskResp struct { ScanInfo *ScanningInfo `json:"scan_info"` ScanTasks []*ScanningTaskResp `json:"scan_tasks"` TotalTasks int `json:"total_tasks"` }
func ListScanningTask ¶ added in v1.9.9
func ListScanningTask(id string, pageNum, pageSize int64, log *zap.SugaredLogger) (*ListScanningTaskResp, error)
type OpenAPICreateScanningReq ¶ added in v1.9.9
type OpenAPICreateScanningReq struct { Name string `json:"name"` ProjectName string `json:"project_name"` Description string `json:"description"` ScannerType string `json:"scanner_type"` ImageName string `json:"image_name"` RepoInfo []*types.OpenAPIRepoInput `json:"repo_info"` // FIMXE: currently only one sonar system is required, so we just fill in the default sonar ID. Addons []*commonmodels.Item `json:"addons"` PrelaunchScript string `json:"prelaunch_script"` SonarParameter string `json:"sonar_parameter"` Script string `json:"script"` EnableQualityGate bool `json:"enable_quality_gate"` AdvancedSetting *types.OpenAPIAdvancedSetting `json:"advanced_settings"` }
func (*OpenAPICreateScanningReq) Validate ¶ added in v1.9.9
func (req *OpenAPICreateScanningReq) Validate() (bool, error)
type Scanning ¶ added in v1.9.9
type Scanning struct { ID string `json:"id"` Name string `json:"name"` ProjectName string `json:"project_name"` Description string `json:"description"` ScannerType string `json:"scanner_type"` ImageID string `json:"image_id"` SonarID string `json:"sonar_id"` Installs []*commonmodels.Item `json:"installs"` Repos []*types.Repository `json:"repos"` PreScript string `json:"pre_script"` // Parameter is for sonarQube type only Parameter string `json:"parameter"` // Script is for other type only Script string `json:"script"` AdvancedSetting *types.ScanningAdvancedSetting `json:"advanced_settings"` CheckQualityGate bool `json:"check_quality_gate"` Outputs []*commonmodels.Output `json:"outputs"` }
func ConvertDBScanningModule ¶ added in v1.9.9
func ConvertDBScanningModule(scanning *commonmodels.Scanning) *Scanning
func GetScanningModuleByID ¶ added in v1.9.9
func GetScanningModuleByID(id string, log *zap.SugaredLogger) (*Scanning, error)
type ScanningInfo ¶ added in v1.9.9
type ScanningRepoInfo ¶ added in v1.9.9
type ScanningRepoInfo struct { CodehostID int `json:"codehost_id"` Source string `json:"source"` RepoOwner string `json:"repo_owner"` RepoNamespace string `json:"repo_namespace"` RepoName string `json:"repo_name"` PR int `json:"pr"` PRs []int `json:"prs"` Branch string `json:"branch"` Tag string `json:"tag"` }
type ScanningStatistic ¶ added in v1.9.9
type ScanningTaskDetail ¶ added in v1.9.9
type ScanningTaskDetail struct { Creator string `json:"creator"` Status string `json:"status"` CreateTime int64 `json:"create_time"` EndTime int64 `json:"end_time"` RepoInfo []*types.Repository `json:"repo_info"` ResultLink string `json:"result_link,omitempty"` }
func GetScanningTaskInfo ¶ added in v1.9.9
func GetScanningTaskInfo(scanningID string, taskID int64, log *zap.SugaredLogger) (*ScanningTaskDetail, error)
type ScanningTaskResp ¶ added in v1.9.9
type TestingDetail ¶
type TestingDetail struct { Name string `json:"name"` Envs []*commonmodels.KeyVal `json:"envs"` Repos []*types.Repository `json:"repos"` Desc string `json:"desc"` ProductName string `json:"product_name"` }
func ListTestingDetails ¶
func ListTestingDetails(productName string, log *zap.SugaredLogger) ([]*TestingDetail, error)
type TestingOpt ¶
type TestingOpt struct { Name string `bson:"name" json:"name"` ProductName string `bson:"product_name" json:"product_name"` Desc string `bson:"desc" json:"desc"` UpdateTime int64 `bson:"update_time" json:"update_time"` UpdateBy string `bson:"update_by" json:"update_by"` TestCaseNum int `bson:"-" json:"test_case_num,omitempty"` ExecuteNum int `bson:"-" json:"execute_num,omitempty"` PassRate float64 `bson:"-" json:"pass_rate,omitempty"` AvgDuration float64 `bson:"-" json:"avg_duration,omitempty"` Workflows []*commonmodels.Workflow `bson:"-" json:"workflows,omitempty"` Schedules *commonmodels.ScheduleCtrl `bson:"-" json:"schedules,omitempty"` Repos []*types.Repository `bson:"repos" json:"repos"` KeyVals []*commonmodels.KeyVal `bson:"key_vals" json:"key_vals"` ClusterID string `bson:"cluster_id" json:"cluster_id"` }
func ListTestingOpt ¶
func ListTestingOpt(productNames []string, testType string, log *zap.SugaredLogger) ([]*TestingOpt, error)
Click to show internal directories.
Click to hide internal directories.