Documentation ¶
Index ¶
- Constants
- func GetDefaultLogger(prefix string) log.BasicLogger
- type AnalysisTaskDetails
- type SonarQube
- func (sonar *SonarQube) CreateProject(name, projectKey string) error
- func (sonar *SonarQube) GetAnalysisTask(ceTaskID string) (interface{}, error)
- func (sonar *SonarQube) GetAnalysisTaskDetails(ceTaskID string) (details AnalysisTaskDetails, err error)
- func (sonar *SonarQube) GetProjectID(projectKey string) (string, error)
- func (sonar *SonarQube) GetQualityGatesProjectStatus(analysisId, projectId, projectKey string) (string, error)
- func (sonar *SonarQube) GetQualityGatesProjectStatusData(analysisId, projectId, projectKey string) (interface{}, error)
- func (sonar *SonarQube) GetSettings(component string, keys []string) (interface{}, error)
- func (sonar *SonarQube) GetVersion() (string, error)
- func (sonar *SonarQube) IsVersion60() bool
- func (sonar *SonarQube) IsVersion64() bool
- func (sonar *SonarQube) ListLanguages() (interface{}, error)
- func (sonar *SonarQube) ListQualityGates() (interface{}, error)
- func (sonar *SonarQube) SelectQualityGates(gateID int, projectID, projectKey string) (interface{}, error)
- func (sonar *SonarQube) SetLogger(logger log.BasicLogger)
- func (sonar *SonarQube) SetSettings(component string, fieldValues map[string]string, key string, value string, ...) (interface{}, error)
- func (sonar *SonarQube) SystemStatus() (map[string]string, error)
Constants ¶
const ( SONAR_VERSION_60 = "6.0.0" SONAR_VERSION_64 = "6.4.0" )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultLogger ¶
func GetDefaultLogger(prefix string) log.BasicLogger
GetDefaultLogger get default logger for sonar
Types ¶
type AnalysisTaskDetails ¶
type AnalysisTaskDetails struct { AnalysisId string `json:"analysisId"` ComponentKey string `json:"componentKey"` ComponentName string `json:"componentName"` // branch is available after SonarQube 6.6 Branch string `json:"branch,omitempty"` Status string `json:"status"` ErrorMessage string `json:"errorMessage,omitempty"` }
type SonarQube ¶
type SonarQube struct { Endpoint string Version string Token string Logger log.BasicLogger // contains filtered or unexported fields }
SonarQube client of Sonarqube
func NewSonarQube ¶
NewSonarQube return sonarqube, retrive endpoint and token from env
func NewSonarQubeArgs ¶
NewSonarQubeArgs return sonarqube with args init
func (*SonarQube) CreateProject ¶
CreateProject create sonar project
func (*SonarQube) GetAnalysisTask ¶
GetAnalysisTask
func (*SonarQube) GetAnalysisTaskDetails ¶
func (sonar *SonarQube) GetAnalysisTaskDetails(ceTaskID string) (details AnalysisTaskDetails, err error)
GetAnalysisTaskDetails get status of task
func (*SonarQube) GetProjectID ¶
GetProjectID get project id by key, only for sonar 6.0.0
func (*SonarQube) GetQualityGatesProjectStatus ¶
func (sonar *SonarQube) GetQualityGatesProjectStatus(analysisId, projectId, projectKey string) (string, error)
GetQualityGatesProjectStatus
func (*SonarQube) GetQualityGatesProjectStatusData ¶
func (sonar *SonarQube) GetQualityGatesProjectStatusData(analysisId, projectId, projectKey string) (interface{}, error)
GetQualityGatesProjectStatusData
func (*SonarQube) GetSettings ¶
GetSettings get sonar project settings since 6.3 和alauda-sonar-scanner中的sonarClient兼容,200 ~ 400 返回json 数据,nil;>=400, 返回字符串,error
func (*SonarQube) GetVersion ¶
GetVersion get sonarqube server version like 6.0.0
func (*SonarQube) IsVersion60 ¶
IsVersion60 true version 6.0.0
func (*SonarQube) IsVersion64 ¶
IsVersion64 true version 6.4.0
func (*SonarQube) ListLanguages ¶
ListLanguages list sonar languages
func (*SonarQube) ListQualityGates ¶
ListQualityGates list sonar quality gates
func (*SonarQube) SelectQualityGates ¶
func (sonar *SonarQube) SelectQualityGates(gateID int, projectID, projectKey string) (interface{}, error)
SelectQualityGates select sonar quality gates
func (*SonarQube) SetLogger ¶
func (sonar *SonarQube) SetLogger(logger log.BasicLogger)
SetLogger set logger to sonar default logger