Documentation ¶
Index ¶
- func CreateProject(itype api.IntegrationType, url, token string, projectKey, projectName string) error
- func DeleteProject(itype api.IntegrationType, url, token string, projectKey string) error
- func Register(itype api.IntegrationType, p ITGProvider) error
- func ScanCode(itype api.IntegrationType, url, token string, config *CodeScanConfig) (string, error)
- func SetCodeScanStatus(itype api.IntegrationType, url, token string, projectID string, ...) error
- func SetQualityGate(itype api.IntegrationType, url, token string, projectKey string, gateId int) error
- func Validate(it *api.Integration) (bool, error)
- type CodeScanConfig
- type ITGProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProject ¶
func CreateProject(itype api.IntegrationType, url, token string, projectKey, projectName string) error
CreateProject create a project.
func DeleteProject ¶
func DeleteProject(itype api.IntegrationType, url, token string, projectKey string) error
DeleteProject delete a project.
func Register ¶
func Register(itype api.IntegrationType, p ITGProvider) error
Register registers integration providers.
func ScanCode ¶
func ScanCode(itype api.IntegrationType, url, token string, config *CodeScanConfig) (string, error)
ScanCode execute code analysis.
func SetCodeScanStatus ¶
func SetCodeScanStatus(itype api.IntegrationType, url, token string, projectID string, s *api.CodeScanStageStatus) error
SetCodeScanStatus set status for CodeScanStageStatus, and the CodeScanStageStatus 's' must not be nil.
func SetQualityGate ¶
func SetQualityGate(itype api.IntegrationType, url, token string, projectKey string, gateId int) error
SetQualityGate sets the project's quality gate.
Types ¶
type CodeScanConfig ¶
type CodeScanConfig struct { SourcePath string `bson:"sourcePath,omitempty" json:"sourcePath,omitempty"` EncodingStyle string `bson:"encodingStyle,omitempty" json:"encodingStyle,omitempty"` Language string `bson:"language,omitempty" json:"language,omitempty"` Threshold int `bson:"threshold,omitempty" json:"threshold,omitempty"` ExtensionAgrs []string `bson:"extensionArgs,omitempty" json:"extensionArgs,omitempty"` ProjectName string `bson:"projectName,omitempty" json:"projectName,omitempty"` ProjectKey string `bson:"projectKey,omitempty" json:"projectKey,omitempty"` }
ScanSonarQubeConfig represents config of sonarqube-type code scan.
type ITGProvider ¶
type ITGProvider interface { // CodeScan execute code analysis. CodeScan(url, token string, config *CodeScanConfig) (string, error) // SetCodeScanStatus sets status for CodeScanStageStatus. SetCodeScanStatus(url, token string, pid string, s *api.CodeScanStageStatus) error // CreateProject create a project. CreateProject(url, token string, projectKey, projectName string) error // SetQualityGate sets the project's quality gate. SetQualityGate(url, token string, projectKey string, gateId int) error // DeleteProject delete a project. DeleteProject(url, token string, projectKey string) error // Validate validate the token. Validate(url, token string) (bool, error) }
ITGProvider is an interface for integration.
func GetProvider ¶
func GetProvider(itype api.IntegrationType) (ITGProvider, error)
GetProvider gets the integration provider by the type.
Click to show internal directories.
Click to hide internal directories.