integrate

package
v0.8.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

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.

func Validate

func Validate(it *api.Integration) (bool, error)

Validate validate the token.

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.

Directories

Path Synopsis
provider

Jump to

Keyboard shortcuts

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