instance

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name        string   `json:"name"`
	DisplayName string   `json:"displayName"`
	Description string   `json:"description"`
	Address     string   `json:"address"`
	Username    string   `json:"username"`
	Password    string   `json:"password"`
	MetricKeys  []string `json:"metricKeys"`
}

Config is the structure of the configuration for a single Opsgenie instance.

type Instance

type Instance struct {
	Name string
	// contains filtered or unexported fields
}

Instance represents a single Jaeger instance, which can be added via the configuration file.

func New

func New(config Config) (*Instance, error)

New returns a new Elasticsearch instance for the given configuration.

func (*Instance) GetProjectMeasures

func (i *Instance) GetProjectMeasures(ctx context.Context, project string, metricKeys []string) (*ResponseProjectMeasures, error)

GetProjectMeasures returns a list of measures for the specified project from SonarQube.

func (*Instance) GetProjects

func (i *Instance) GetProjects(ctx context.Context, query, pageSize, pageNumber string) (*ResponseProjects, error)

GetProjects returns a list of projects from SonarQube.

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 Paging

type Paging struct {
	PageIndex int64 `json:"pageIndex"`
	PageSize  int64 `json:"pageSize"`
	Total     int64 `json:"total"`
}

type Project

type Project struct {
	Key              string `json:"key"`
	Name             string `json:"name"`
	Qualifier        string `json:"qualifier"`
	Visibility       string `json:"visibility"`
	LastAnalysisDate string `json:"lastAnalysisDate"`
	Revision         string `json:"revision"`
}

type ProjectMeasures

type ProjectMeasures struct {
	Key         string `json:"key"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Qualifier   string `json:"qualifier"`
	Measures    []struct {
		Metric    string `json:"metric"`
		Value     string `json:"value"`
		BestValue bool   `json:"bestValue,omitempty"`
	} `json:"measures"`
}

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"`
}

type ResponseProjects

type ResponseProjects struct {
	Paging     Paging    `json:"paging"`
	Components []Project `json:"components"`
}

Jump to

Keyboard shortcuts

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