sonarqube

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRenderedQualityGate

func GetRenderedQualityGate(qg string) string

func PRNameFromIndex

func PRNameFromIndex(index int64) string

func ParsePRIndex

func ParsePRIndex(name string) (int, error)

Types

type BodyReader

type BodyReader func(io.Reader) ([]byte, error)

type ClientInterface

type ClientInterface interface {
	Do(req *http.Request) (*http.Response, error)
}

type CommentComposeData

type CommentComposeData struct {
	Key         string
	PRName      string
	Url         string
	QualityGate string
}

type Error

type Error struct {
	Message string `json:"msg"`
}

type HttpRequest

type HttpRequest func(method string, target string, body io.Reader) (*http.Request, error)

type MeasuresComponent

type MeasuresComponent struct {
	PullRequest string                     `json:"pullRequest"`
	Measures    []MeasuresComponentMeasure `json:"measures"`
}

type MeasuresComponentMeasure

type MeasuresComponentMeasure struct {
	Metric string  `json:"metric"`
	Value  string  `json:"value"`
	Period *period `json:"period,omitempty"`
}

type MeasuresComponentMetric

type MeasuresComponentMetric struct {
	Key  string `json:"key"`
	Name string `json:"name"`
}

type MeasuresResponse

type MeasuresResponse struct {
	Component MeasuresComponent         `json:"component"`
	Metrics   []MeasuresComponentMetric `json:"metrics"`
	Errors    []Error                   `json:"errors"`
}

func (*MeasuresResponse) GetRenderedMarkdownTable

func (mr *MeasuresResponse) GetRenderedMarkdownTable() string

type PullRequest

type PullRequest struct {
	Key    string `json:"key"`
	Status struct {
		QualityGateStatus string `json:"qualityGateStatus"`
	} `json:"status"`
}

type PullsResponse

type PullsResponse struct {
	PullRequests []PullRequest `json:"pullRequests"`
	Errors       []Error       `json:"errors"`
}

func (*PullsResponse) GetPullRequest

func (r *PullsResponse) GetPullRequest(name string) *PullRequest

type SonarQubeSdk

type SonarQubeSdk struct {
	// contains filtered or unexported fields
}

func New

func New(configuration *settings.SonarQubeConfig) *SonarQubeSdk

func (*SonarQubeSdk) ComposeGiteaComment

func (sdk *SonarQubeSdk) ComposeGiteaComment(data *CommentComposeData) (string, error)

func (*SonarQubeSdk) GetMeasures

func (sdk *SonarQubeSdk) GetMeasures(project string, branch string) (*MeasuresResponse, error)

func (*SonarQubeSdk) GetPullRequest

func (sdk *SonarQubeSdk) GetPullRequest(project string, index int64) (*PullRequest, error)

func (*SonarQubeSdk) GetPullRequestUrl

func (sdk *SonarQubeSdk) GetPullRequestUrl(project string, index int64) string

type SonarQubeSdkInterface

type SonarQubeSdkInterface interface {
	GetMeasures(string, string) (*MeasuresResponse, error)
	GetPullRequestUrl(string, int64) string
	GetPullRequest(string, int64) (*PullRequest, error)
	ComposeGiteaComment(*CommentComposeData) (string, error)
}

Jump to

Keyboard shortcuts

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