compat

package
v0.11.2-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorType

type ErrorType string

type QueryResult

type QueryResult struct {
	Type   model.ValueType `json:"resultType"`
	Result interface{}     `json:"result"`

	// The decoded value.
	V model.Value
}

Struct for unmarshalling from github.com/prometheus/common/model

func UnmarshalPrometheusResponse

func UnmarshalPrometheusResponse(data []byte) (*QueryResult, error)

func (*QueryResult) GetMatrix

func (qr *QueryResult) GetMatrix() (*model.Matrix, error)

func (*QueryResult) GetVector

func (qr *QueryResult) GetVector() (*model.Vector, error)

func (*QueryResult) UnmarshalJSON

func (qr *QueryResult) UnmarshalJSON(b []byte) error

Unmarshalling for `queryResult`

type Response

type Response struct {
	Status    status      `json:"status"`
	Data      interface{} `json:"data,omitempty"`
	ErrorType errorType   `json:"errorType,omitempty"`
	Error     string      `json:"error,omitempty"`
	Warnings  []string    `json:"warnings,omitempty"`
}

Generic struct for unmarshalling prometheus http api responses https://github.com/prometheus/prometheus/blob/bcd548c88b06543c8eeb19e68bef4adefb7b95fb/web/api/v1/api.go#L140

func UnmarshallPrometheusWebResponse

func UnmarshallPrometheusWebResponse(resp *http.Response, _ *zap.SugaredLogger) (*Response, error)

Jump to

Keyboard shortcuts

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