unmarshal

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 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 added in v0.8.2

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 added in v0.8.2

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

func (*QueryResult) GetVector added in v0.8.2

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

func (*QueryResult) UnmarshalJSON added in v0.8.2

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

Unmarshalling for `queryResult`

type Response added in v0.8.2

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 added in v0.6.0

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