Documentation
¶
Index ¶
- type Config
- type Instance
- type Metric
- type MockInstance
- func (_m *MockInstance) GetName() string
- func (_m *MockInstance) GetProjectMeasures(ctx context.Context, project string, metricKeys []string) (*ResponseProjectMeasures, error)
- func (_m *MockInstance) GetProjects(ctx context.Context, query string, pageSize string, pageNumber string) (*ResponseProjects, error)
- type NewMockInstanceT
- type Paging
- type Project
- type ProjectMeasures
- type ResponseError
- type ResponseProjectMeasures
- type ResponseProjects
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Address string `json:"address"`
Username string `json:"username"`
Password string `json:"password"`
Organization string `json:"organization"`
MetricKeys []string `json:"metricKeys"`
}
Config is the structure of the configuration for a single SonarQube instance.
type Instance ¶
type Instance interface {
GetName() string
GetProjects(ctx context.Context, query, pageSize, pageNumber string) (*ResponseProjects, error)
GetProjectMeasures(ctx context.Context, project string, metricKeys []string) (*ResponseProjectMeasures, error)
}
Instance is the interface which must be implemented by a single SonarQube instance.
type Metric ¶
type Metric struct {
Key string `json:"key"`
Name string `json:"name"`
Description string `json:"description"`
Domain string `json:"domain"`
Type string `json:"type"`
HigherValuesAreBetter bool `json:"higherValuesAreBetter"`
Qualitative bool `json:"qualitative"`
Hidden bool `json:"hidden"`
DecimalScale int `json:"decimalScale,omitempty"`
BestValue string `json:"bestValue,omitempty"`
WorstValue string `json:"worstValue,omitempty"`
}
type MockInstance ¶
MockInstance is an autogenerated mock type for the Instance type
func NewMockInstance ¶
func NewMockInstance(t NewMockInstanceT) *MockInstance
NewMockInstance creates a new instance of MockInstance. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockInstance) GetName ¶
func (_m *MockInstance) GetName() string
GetName provides a mock function with given fields:
func (*MockInstance) GetProjectMeasures ¶
func (_m *MockInstance) GetProjectMeasures(ctx context.Context, project string, metricKeys []string) (*ResponseProjectMeasures, error)
GetProjectMeasures provides a mock function with given fields: ctx, project, metricKeys
func (*MockInstance) GetProjects ¶
func (_m *MockInstance) GetProjects(ctx context.Context, query string, pageSize string, pageNumber string) (*ResponseProjects, error)
GetProjects provides a mock function with given fields: ctx, query, pageSize, pageNumber
type NewMockInstanceT ¶
type ProjectMeasures ¶
type ResponseError ¶
type ResponseError struct {
Errors []struct {
Msg string `json:"msg"`
} `json:"errors"`
}
ResponseError is the structure for a failed SonarQube API request.
type ResponseProjectMeasures ¶
type ResponseProjectMeasures struct {
Component ProjectMeasures `json:"component"`
Metrics []Metric `json:"metrics"`
}