sonar

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReportTaskPath

func GetReportTaskPath() string

Types

type Client

type Client interface {
	GetTaskDetails(ceTaskID string) (*TaskDetails, error)
	GetSonarIntotoStatement(ceTaskID string) ([]byte, error)
}

func NewClient

func NewClient(sonarURL, token string) (Client, error)

type Provider

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

func (*Provider) GetStatement

func (p *Provider) GetStatement(ceTaskID string, pollingMaxRetries *int, pollingRetryIntervalMs *int) ([]byte, error)

GetStatement tries to retrieve an in-toto statement from the integration endpoint. If successful, returns the statement bytes.

type ReportTask

type ReportTask struct {
	CeTaskURL  string
	CeTaskID   string
	ProjectKey string
	ServerURL  string
}

type StatementProvider

type StatementProvider interface {
	GetStatement(ceTaskID string, pollingMaxRetries *int, pollingRetryIntervalMs *int) ([]byte, error)
}

func NewSonarProviderWithCredentials

func NewSonarProviderWithCredentials(sonarURL, token string) (StatementProvider, error)

NewSonarProviderWithCredentials creates a new StatementProvider with SonarQube credentials

type StatementResolver

type StatementResolver interface {
	ResolveStatement() (statement []byte, err error)
}

StatementResolver resolves a full in-toto statement.

func NewStatementResolver

func NewStatementResolver() StatementResolver

type TaskDetails

type TaskDetails struct {
	Task struct {
		ID                 string      `json:"id"`
		Type               string      `json:"type"`
		ComponentID        string      `json:"componentId"`
		ComponentKey       string      `json:"componentKey"`
		ComponentName      string      `json:"componentName"`
		ComponentQualifier string      `json:"componentQualifier"`
		AnalysisID         string      `json:"analysisId"`
		Status             string      `json:"status"`
		SubmittedAt        string      `json:"submittedAt"`
		StartedAt          string      `json:"startedAt"`
		ExecutedAt         string      `json:"executedAt"`
		ExecutionTimeMs    int         `json:"executionTimeMs"`
		Logs               interface{} `json:"logs"`
		HasScannerContext  bool        `json:"hasScannerContext"`
		Organization       string      `json:"organization"`
	} `json:"task"`
}

Jump to

Keyboard shortcuts

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