promapi

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package promapi contains generated code for OpenAPI specification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailToCode

func FailToCode(f FailErrorType) int

FailToCode converts FailErrorType to http status code.

func WithServerURL

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

Types

type Alert

type Alert struct {
	Labels      LabelSet    `json:"labels"`
	Annotations LabelSet    `json:"annotations"`
	State       string      `json:"state"`
	ActiveAt    OptDateTime `json:"activeAt"`
	Value       string      `json:"value"`
}

Ref: #/components/schemas/Alert

func (*Alert) Decode

func (s *Alert) Decode(d *jx.Decoder) error

Decode decodes Alert from json.

func (*Alert) Encode

func (s *Alert) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Alert) GetActiveAt

func (s *Alert) GetActiveAt() OptDateTime

GetActiveAt returns the value of ActiveAt.

func (*Alert) GetAnnotations

func (s *Alert) GetAnnotations() LabelSet

GetAnnotations returns the value of Annotations.

func (*Alert) GetLabels

func (s *Alert) GetLabels() LabelSet

GetLabels returns the value of Labels.

func (*Alert) GetState

func (s *Alert) GetState() string

GetState returns the value of State.

func (*Alert) GetValue

func (s *Alert) GetValue() string

GetValue returns the value of Value.

func (*Alert) MarshalJSON

func (s *Alert) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Alert) SetActiveAt

func (s *Alert) SetActiveAt(val OptDateTime)

SetActiveAt sets the value of ActiveAt.

func (*Alert) SetAnnotations

func (s *Alert) SetAnnotations(val LabelSet)

SetAnnotations sets the value of Annotations.

func (*Alert) SetFake

func (s *Alert) SetFake()

SetFake set fake values.

func (*Alert) SetLabels

func (s *Alert) SetLabels(val LabelSet)

SetLabels sets the value of Labels.

func (*Alert) SetState

func (s *Alert) SetState(val string)

SetState sets the value of State.

func (*Alert) SetValue

func (s *Alert) SetValue(val string)

SetValue sets the value of Value.

func (*Alert) UnmarshalJSON

func (s *Alert) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AlertingRule

type AlertingRule struct {
	State          OptAlertingRuleState `json:"state"`
	Name           string               `json:"name"`
	Query          string               `json:"query"`
	Duration       string               `json:"duration"`
	Labels         LabelSet             `json:"labels"`
	Annotations    LabelSet             `json:"annotations"`
	Alerts         []Alert              `json:"alerts"`
	Health         RuleHealth           `json:"health"`
	LastError      string               `json:"lastError"`
	EvaluationTime float64              `json:"evaluationTime"`
	LastEvaluation time.Time            `json:"lastEvaluation"`
}

Ref: #/components/schemas/AlertingRule

func (*AlertingRule) Decode

func (s *AlertingRule) Decode(d *jx.Decoder) error

Decode decodes AlertingRule from json.

func (*AlertingRule) Encode

func (s *AlertingRule) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AlertingRule) GetAlerts

func (s *AlertingRule) GetAlerts() []Alert

GetAlerts returns the value of Alerts.

func (*AlertingRule) GetAnnotations

func (s *AlertingRule) GetAnnotations() LabelSet

GetAnnotations returns the value of Annotations.

func (*AlertingRule) GetDuration

func (s *AlertingRule) GetDuration() string

GetDuration returns the value of Duration.

func (*AlertingRule) GetEvaluationTime

func (s *AlertingRule) GetEvaluationTime() float64

GetEvaluationTime returns the value of EvaluationTime.

func (*AlertingRule) GetHealth

func (s *AlertingRule) GetHealth() RuleHealth

GetHealth returns the value of Health.

func (*AlertingRule) GetLabels

func (s *AlertingRule) GetLabels() LabelSet

GetLabels returns the value of Labels.

func (*AlertingRule) GetLastError

func (s *AlertingRule) GetLastError() string

GetLastError returns the value of LastError.

func (*AlertingRule) GetLastEvaluation

func (s *AlertingRule) GetLastEvaluation() time.Time

GetLastEvaluation returns the value of LastEvaluation.

func (*AlertingRule) GetName

func (s *AlertingRule) GetName() string

GetName returns the value of Name.

func (*AlertingRule) GetQuery

func (s *AlertingRule) GetQuery() string

GetQuery returns the value of Query.

func (*AlertingRule) GetState

func (s *AlertingRule) GetState() OptAlertingRuleState

GetState returns the value of State.

func (*AlertingRule) MarshalJSON

func (s *AlertingRule) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AlertingRule) SetAlerts

func (s *AlertingRule) SetAlerts(val []Alert)

SetAlerts sets the value of Alerts.

func (*AlertingRule) SetAnnotations

func (s *AlertingRule) SetAnnotations(val LabelSet)

SetAnnotations sets the value of Annotations.

func (*AlertingRule) SetDuration

func (s *AlertingRule) SetDuration(val string)

SetDuration sets the value of Duration.

func (*AlertingRule) SetEvaluationTime

func (s *AlertingRule) SetEvaluationTime(val float64)

SetEvaluationTime sets the value of EvaluationTime.

func (*AlertingRule) SetFake

func (s *AlertingRule) SetFake()

SetFake set fake values.

func (*AlertingRule) SetHealth

func (s *AlertingRule) SetHealth(val RuleHealth)

SetHealth sets the value of Health.

func (*AlertingRule) SetLabels

func (s *AlertingRule) SetLabels(val LabelSet)

SetLabels sets the value of Labels.

func (*AlertingRule) SetLastError

func (s *AlertingRule) SetLastError(val string)

SetLastError sets the value of LastError.

func (*AlertingRule) SetLastEvaluation

func (s *AlertingRule) SetLastEvaluation(val time.Time)

SetLastEvaluation sets the value of LastEvaluation.

func (*AlertingRule) SetName

func (s *AlertingRule) SetName(val string)

SetName sets the value of Name.

func (*AlertingRule) SetQuery

func (s *AlertingRule) SetQuery(val string)

SetQuery sets the value of Query.

func (*AlertingRule) SetState

func (s *AlertingRule) SetState(val OptAlertingRuleState)

SetState sets the value of State.

func (*AlertingRule) UnmarshalJSON

func (s *AlertingRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AlertingRule) Validate

func (s *AlertingRule) Validate() error

type AlertingRuleState

type AlertingRuleState string
const (
	AlertingRuleStatePending  AlertingRuleState = "pending"
	AlertingRuleStateFiring   AlertingRuleState = "firing"
	AlertingRuleStateInactive AlertingRuleState = "inactive"
)

func (AlertingRuleState) AllValues added in v0.1.0

func (AlertingRuleState) AllValues() []AlertingRuleState

AllValues returns all AlertingRuleState values.

func (*AlertingRuleState) Decode

func (s *AlertingRuleState) Decode(d *jx.Decoder) error

Decode decodes AlertingRuleState from json.

func (AlertingRuleState) Encode

func (s AlertingRuleState) Encode(e *jx.Encoder)

Encode encodes AlertingRuleState as json.

func (AlertingRuleState) MarshalJSON

func (s AlertingRuleState) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (AlertingRuleState) MarshalText

func (s AlertingRuleState) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*AlertingRuleState) SetFake

func (s *AlertingRuleState) SetFake()

SetFake set fake values.

func (*AlertingRuleState) UnmarshalJSON

func (s *AlertingRuleState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AlertingRuleState) UnmarshalText

func (s *AlertingRuleState) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (AlertingRuleState) Validate

func (s AlertingRuleState) Validate() error

type Bucket added in v0.1.0

type Bucket struct {
	BoundaryType int
	Lower        float64
	Upper        float64
	Count        float64
}

Ref: #/components/schemas/Bucket

func (*Bucket) Decode added in v0.1.0

func (s *Bucket) Decode(d *jx.Decoder) error

Decode decodes Bucket from json.

func (*Bucket) Encode added in v0.1.0

func (s *Bucket) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Bucket) GetBoundaryType added in v0.1.0

func (s *Bucket) GetBoundaryType() int

GetBoundaryType returns the value of BoundaryType.

func (*Bucket) GetCount added in v0.1.0

func (s *Bucket) GetCount() float64

GetCount returns the value of Count.

func (*Bucket) GetLower added in v0.1.0

func (s *Bucket) GetLower() float64

GetLower returns the value of Lower.

func (*Bucket) GetUpper added in v0.1.0

func (s *Bucket) GetUpper() float64

GetUpper returns the value of Upper.

func (*Bucket) MarshalJSON added in v0.1.0

func (s *Bucket) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Bucket) SetBoundaryType added in v0.1.0

func (s *Bucket) SetBoundaryType(val int)

SetBoundaryType sets the value of BoundaryType.

func (*Bucket) SetCount added in v0.1.0

func (s *Bucket) SetCount(val float64)

SetCount sets the value of Count.

func (*Bucket) SetFake added in v0.1.0

func (s *Bucket) SetFake()

SetFake set fake values.

func (*Bucket) SetLower added in v0.1.0

func (s *Bucket) SetLower(val float64)

SetLower sets the value of Lower.

func (*Bucket) SetUpper added in v0.1.0

func (s *Bucket) SetUpper(val float64)

SetUpper sets the value of Upper.

func (*Bucket) UnmarshalJSON added in v0.1.0

func (s *Bucket) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Bucket) Validate added in v0.1.0

func (s *Bucket) Validate() error

type Client

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

Client implements OAS client.

func NewClient

func NewClient(serverURL string, opts ...ClientOption) (*Client, error)

NewClient initializes new Client defined by OAS.

func (*Client) GetLabelValues

func (c *Client) GetLabelValues(ctx context.Context, params GetLabelValuesParams) (*LabelValuesResponse, error)

GetLabelValues invokes getLabelValues operation.

GET /api/v1/label/{label}/values

func (*Client) GetLabels

func (c *Client) GetLabels(ctx context.Context, params GetLabelsParams) (*LabelsResponse, error)

GetLabels invokes getLabels operation.

GET /api/v1/labels

func (*Client) GetMetadata

func (c *Client) GetMetadata(ctx context.Context, params GetMetadataParams) (*MetadataResponse, error)

GetMetadata invokes getMetadata operation.

GET /api/v1/metadata

func (*Client) GetQuery

func (c *Client) GetQuery(ctx context.Context, params GetQueryParams) (*QueryResponse, error)

GetQuery invokes getQuery operation.

Query Prometheus.

GET /api/v1/query

func (*Client) GetQueryExemplars

func (c *Client) GetQueryExemplars(ctx context.Context, params GetQueryExemplarsParams) (*QueryExemplarsResponse, error)

GetQueryExemplars invokes getQueryExemplars operation.

Query Prometheus.

GET /api/v1/query_exemplars

func (*Client) GetQueryRange

func (c *Client) GetQueryRange(ctx context.Context, params GetQueryRangeParams) (*QueryResponse, error)

GetQueryRange invokes getQueryRange operation.

Query Prometheus.

GET /api/v1/query_range

func (*Client) GetRules

func (c *Client) GetRules(ctx context.Context, params GetRulesParams) (*RulesResponse, error)

GetRules invokes getRules operation.

GET /api/v1/rules

func (*Client) GetSeries

func (c *Client) GetSeries(ctx context.Context, params GetSeriesParams) (*SeriesResponse, error)

GetSeries invokes getSeries operation.

Query Prometheus.

GET /api/v1/series

func (*Client) PostLabels

func (c *Client) PostLabels(ctx context.Context, request *LabelsForm) (*LabelsResponse, error)

PostLabels invokes postLabels operation.

POST /api/v1/labels

func (*Client) PostQuery

func (c *Client) PostQuery(ctx context.Context, request *QueryForm) (*QueryResponse, error)

PostQuery invokes postQuery operation.

Query Prometheus.

POST /api/v1/query

func (*Client) PostQueryExemplars

func (c *Client) PostQueryExemplars(ctx context.Context, request *ExemplarsForm) (*QueryExemplarsResponse, error)

PostQueryExemplars invokes postQueryExemplars operation.

Query Prometheus.

POST /api/v1/query_exemplars

func (*Client) PostQueryRange

func (c *Client) PostQueryRange(ctx context.Context, request *QueryRangeForm) (*QueryResponse, error)

PostQueryRange invokes postQueryRange operation.

Query Prometheus.

POST /api/v1/query_range

func (*Client) PostSeries

func (c *Client) PostSeries(ctx context.Context, request *SeriesForm) (*SeriesResponse, error)

PostSeries invokes postSeries operation.

Query Prometheus.

POST /api/v1/series

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption is client config option.

func WithClient

func WithClient(client ht.Client) ClientOption

WithClient specifies http client to use.

type Data

type Data struct {
	Type   DataType // switch on this field
	Matrix Matrix
	Vector Vector
	Scalar Scalar
	String String
}

Ref: #/components/schemas/Data Data represents sum type.

func NewMatrixData

func NewMatrixData(v Matrix) Data

NewMatrixData returns new Data from Matrix.

func NewScalarData

func NewScalarData(v Scalar) Data

NewScalarData returns new Data from Scalar.

func NewStringData

func NewStringData(v String) Data

NewStringData returns new Data from String.

func NewVectorData

func NewVectorData(v Vector) Data

NewVectorData returns new Data from Vector.

func (*Data) Decode

func (s *Data) Decode(d *jx.Decoder) error

Decode decodes Data from json.

func (Data) Encode

func (s Data) Encode(e *jx.Encoder)

Encode encodes Data as json.

func (Data) GetMatrix

func (s Data) GetMatrix() (v Matrix, ok bool)

GetMatrix returns Matrix and true boolean if Data is Matrix.

func (Data) GetScalar

func (s Data) GetScalar() (v Scalar, ok bool)

GetScalar returns Scalar and true boolean if Data is Scalar.

func (Data) GetString

func (s Data) GetString() (v String, ok bool)

GetString returns String and true boolean if Data is String.

func (Data) GetVector

func (s Data) GetVector() (v Vector, ok bool)

GetVector returns Vector and true boolean if Data is Vector.

func (Data) IsMatrix

func (s Data) IsMatrix() bool

IsMatrix reports whether Data is Matrix.

func (Data) IsScalar

func (s Data) IsScalar() bool

IsScalar reports whether Data is Scalar.

func (Data) IsString

func (s Data) IsString() bool

IsString reports whether Data is String.

func (Data) IsVector

func (s Data) IsVector() bool

IsVector reports whether Data is Vector.

func (Data) MarshalJSON

func (s Data) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Data) SetFake

func (s *Data) SetFake()

SetFake set fake values.

func (*Data) SetMatrix

func (s *Data) SetMatrix(v Matrix)

SetMatrix sets Data to Matrix.

func (*Data) SetScalar

func (s *Data) SetScalar(v Scalar)

SetScalar sets Data to Scalar.

func (*Data) SetString

func (s *Data) SetString(v String)

SetString sets Data to String.

func (*Data) SetVector

func (s *Data) SetVector(v Vector)

SetVector sets Data to Vector.

func (*Data) UnmarshalJSON

func (s *Data) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (Data) Validate

func (s Data) Validate() error

type DataType

type DataType string

DataType is oneOf type of Data.

const (
	MatrixData DataType = "matrix"
	VectorData DataType = "vector"
	ScalarData DataType = "scalar"
	StringData DataType = "string"
)

Possible values for DataType.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type Exemplar

type Exemplar struct {
	Labels    LabelSet   `json:"labels"`
	Value     float64    `json:"value"`
	Timestamp OptFloat64 `json:"timestamp"`
}

Ref: #/components/schemas/Exemplar

func (*Exemplar) Decode

func (s *Exemplar) Decode(d *jx.Decoder) error

Decode decodes Exemplar from json.

func (*Exemplar) Encode

func (s *Exemplar) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Exemplar) GetLabels

func (s *Exemplar) GetLabels() LabelSet

GetLabels returns the value of Labels.

func (*Exemplar) GetTimestamp

func (s *Exemplar) GetTimestamp() OptFloat64

GetTimestamp returns the value of Timestamp.

func (*Exemplar) GetValue

func (s *Exemplar) GetValue() float64

GetValue returns the value of Value.

func (*Exemplar) MarshalJSON

func (s *Exemplar) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Exemplar) SetFake

func (s *Exemplar) SetFake()

SetFake set fake values.

func (*Exemplar) SetLabels

func (s *Exemplar) SetLabels(val LabelSet)

SetLabels sets the value of Labels.

func (*Exemplar) SetTimestamp

func (s *Exemplar) SetTimestamp(val OptFloat64)

SetTimestamp sets the value of Timestamp.

func (*Exemplar) SetValue

func (s *Exemplar) SetValue(val float64)

SetValue sets the value of Value.

func (*Exemplar) UnmarshalJSON

func (s *Exemplar) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Exemplar) Validate

func (s *Exemplar) Validate() error

type Exemplars

type Exemplars []ExemplarsSet

func (*Exemplars) Decode

func (s *Exemplars) Decode(d *jx.Decoder) error

Decode decodes Exemplars from json.

func (Exemplars) Encode

func (s Exemplars) Encode(e *jx.Encoder)

Encode encodes Exemplars as json.

func (Exemplars) MarshalJSON

func (s Exemplars) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Exemplars) SetFake

func (s *Exemplars) SetFake()

SetFake set fake values.

func (*Exemplars) UnmarshalJSON

func (s *Exemplars) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (Exemplars) Validate

func (s Exemplars) Validate() error

type ExemplarsForm added in v0.2.0

type ExemplarsForm struct {
	Query string              `json:"query"`
	Start PrometheusTimestamp `json:"start"`
	End   PrometheusTimestamp `json:"end"`
}

Ref: #/components/schemas/ExemplarsForm

func (*ExemplarsForm) GetEnd added in v0.2.0

func (s *ExemplarsForm) GetEnd() PrometheusTimestamp

GetEnd returns the value of End.

func (*ExemplarsForm) GetQuery added in v0.2.0

func (s *ExemplarsForm) GetQuery() string

GetQuery returns the value of Query.

func (*ExemplarsForm) GetStart added in v0.2.0

func (s *ExemplarsForm) GetStart() PrometheusTimestamp

GetStart returns the value of Start.

func (*ExemplarsForm) SetEnd added in v0.2.0

func (s *ExemplarsForm) SetEnd(val PrometheusTimestamp)

SetEnd sets the value of End.

func (*ExemplarsForm) SetQuery added in v0.2.0

func (s *ExemplarsForm) SetQuery(val string)

SetQuery sets the value of Query.

func (*ExemplarsForm) SetStart added in v0.2.0

func (s *ExemplarsForm) SetStart(val PrometheusTimestamp)

SetStart sets the value of Start.

type ExemplarsSet

type ExemplarsSet struct {
	SeriesLabels OptLabelSet `json:"seriesLabels"`
	Exemplars    []Exemplar  `json:"exemplars"`
}

Ref: #/components/schemas/ExemplarsSet

func (*ExemplarsSet) Decode

func (s *ExemplarsSet) Decode(d *jx.Decoder) error

Decode decodes ExemplarsSet from json.

func (*ExemplarsSet) Encode

func (s *ExemplarsSet) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ExemplarsSet) GetExemplars

func (s *ExemplarsSet) GetExemplars() []Exemplar

GetExemplars returns the value of Exemplars.

func (*ExemplarsSet) GetSeriesLabels

func (s *ExemplarsSet) GetSeriesLabels() OptLabelSet

GetSeriesLabels returns the value of SeriesLabels.

func (*ExemplarsSet) MarshalJSON

func (s *ExemplarsSet) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ExemplarsSet) SetExemplars

func (s *ExemplarsSet) SetExemplars(val []Exemplar)

SetExemplars sets the value of Exemplars.

func (*ExemplarsSet) SetFake

func (s *ExemplarsSet) SetFake()

SetFake set fake values.

func (*ExemplarsSet) SetSeriesLabels

func (s *ExemplarsSet) SetSeriesLabels(val OptLabelSet)

SetSeriesLabels sets the value of SeriesLabels.

func (*ExemplarsSet) UnmarshalJSON

func (s *ExemplarsSet) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ExemplarsSet) Validate

func (s *ExemplarsSet) Validate() error

type FPoint added in v0.1.0

type FPoint struct {
	T float64
	V float64
}

Ref: #/components/schemas/FPoint

func (*FPoint) Decode added in v0.1.0

func (s *FPoint) Decode(d *jx.Decoder) error

Decode decodes FPoint from json.

func (*FPoint) Encode added in v0.1.0

func (s *FPoint) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*FPoint) GetT added in v0.1.0

func (s *FPoint) GetT() float64

GetT returns the value of T.

func (*FPoint) GetV added in v0.1.0

func (s *FPoint) GetV() float64

GetV returns the value of V.

func (*FPoint) MarshalJSON added in v0.1.0

func (s *FPoint) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*FPoint) SetFake added in v0.1.0

func (s *FPoint) SetFake()

SetFake set fake values.

func (*FPoint) SetT added in v0.1.0

func (s *FPoint) SetT(val float64)

SetT sets the value of T.

func (*FPoint) SetV added in v0.1.0

func (s *FPoint) SetV(val float64)

SetV sets the value of V.

func (*FPoint) UnmarshalJSON added in v0.1.0

func (s *FPoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*FPoint) Validate added in v0.1.0

func (s *FPoint) Validate() error

type Fail

type Fail struct {
	Status    string        `json:"status"`
	Error     string        `json:"error"`
	ErrorType FailErrorType `json:"errorType"`
	Data      OptData       `json:"data"`
}

May still contain data. Ref: #/components/schemas/Fail

func (*Fail) Decode

func (s *Fail) Decode(d *jx.Decoder) error

Decode decodes Fail from json.

func (*Fail) Encode

func (s *Fail) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Fail) GetData

func (s *Fail) GetData() OptData

GetData returns the value of Data.

func (*Fail) GetError

func (s *Fail) GetError() string

GetError returns the value of Error.

func (*Fail) GetErrorType

func (s *Fail) GetErrorType() FailErrorType

GetErrorType returns the value of ErrorType.

func (*Fail) GetStatus

func (s *Fail) GetStatus() string

GetStatus returns the value of Status.

func (*Fail) MarshalJSON

func (s *Fail) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Fail) SetData

func (s *Fail) SetData(val OptData)

SetData sets the value of Data.

func (*Fail) SetError

func (s *Fail) SetError(val string)

SetError sets the value of Error.

func (*Fail) SetErrorType

func (s *Fail) SetErrorType(val FailErrorType)

SetErrorType sets the value of ErrorType.

func (*Fail) SetFake

func (s *Fail) SetFake()

SetFake set fake values.

func (*Fail) SetStatus

func (s *Fail) SetStatus(val string)

SetStatus sets the value of Status.

func (*Fail) UnmarshalJSON

func (s *Fail) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Fail) Validate

func (s *Fail) Validate() error

type FailErrorType

type FailErrorType string
const (
	FailErrorTypeTimeout     FailErrorType = "timeout"
	FailErrorTypeCanceled    FailErrorType = "canceled"
	FailErrorTypeExecution   FailErrorType = "execution"
	FailErrorTypeBadData     FailErrorType = "bad_data"
	FailErrorTypeInternal    FailErrorType = "internal"
	FailErrorTypeUnavailable FailErrorType = "unavailable"
	FailErrorTypeNotFound    FailErrorType = "not_found"
)

func (FailErrorType) AllValues added in v0.1.0

func (FailErrorType) AllValues() []FailErrorType

AllValues returns all FailErrorType values.

func (*FailErrorType) Decode

func (s *FailErrorType) Decode(d *jx.Decoder) error

Decode decodes FailErrorType from json.

func (FailErrorType) Encode

func (s FailErrorType) Encode(e *jx.Encoder)

Encode encodes FailErrorType as json.

func (FailErrorType) MarshalJSON

func (s FailErrorType) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (FailErrorType) MarshalText

func (s FailErrorType) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*FailErrorType) SetFake

func (s *FailErrorType) SetFake()

SetFake set fake values.

func (*FailErrorType) UnmarshalJSON

func (s *FailErrorType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*FailErrorType) UnmarshalText

func (s *FailErrorType) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (FailErrorType) Validate

func (s FailErrorType) Validate() error

type FailStatusCode

type FailStatusCode struct {
	StatusCode int
	Response   Fail
}

FailStatusCode wraps Fail with StatusCode.

func (*FailStatusCode) Error

func (s *FailStatusCode) Error() string

func (*FailStatusCode) GetResponse

func (s *FailStatusCode) GetResponse() Fail

GetResponse returns the value of Response.

func (*FailStatusCode) GetStatusCode

func (s *FailStatusCode) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*FailStatusCode) SetResponse

func (s *FailStatusCode) SetResponse(val Fail)

SetResponse sets the value of Response.

func (*FailStatusCode) SetStatusCode

func (s *FailStatusCode) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

func (*FailStatusCode) Validate

func (s *FailStatusCode) Validate() error

type GetLabelValuesParams

type GetLabelValuesParams struct {
	// Label to query values.
	Label string
	// Start timestamp.
	Start OptPrometheusTimestamp
	// End timestamp.
	End OptPrometheusTimestamp
	// Repeated series selector argument that selects the series from which to read the label names.
	Match []string
}

GetLabelValuesParams is parameters of getLabelValues operation.

type GetLabelsParams

type GetLabelsParams struct {
	// Start timestamp.
	Start OptPrometheusTimestamp
	// End timestamp.
	End OptPrometheusTimestamp
	// Repeated series selector argument that selects the series from which to read the label names.
	Match []string
}

GetLabelsParams is parameters of getLabels operation.

type GetMetadataParams

type GetMetadataParams struct {
	// Maximum number of metrics to return.
	Limit OptInt
	// FIXME(tdakkota): undocumented.
	LimitPerMetric OptInt
	// A metric name to filter metadata for.
	// All metric metadata is retrieved if left empty.
	Metric OptString
}

GetMetadataParams is parameters of getMetadata operation.

type GetQueryExemplarsParams

type GetQueryExemplarsParams struct {
	// Prometheus expression query string.
	Query string
	// Start timestamp.
	Start PrometheusTimestamp
	// End timestamp.
	End PrometheusTimestamp
}

GetQueryExemplarsParams is parameters of getQueryExemplars operation.

type GetQueryParams

type GetQueryParams struct {
	// Prometheus expression query string.
	Query string
	// Evaluation timestamp.
	Time OptPrometheusTimestamp
	// Lookback delta duration in duration format or float number of seconds.
	LookbackDelta OptString
	// Statistics to return.
	Stats OptString
}

GetQueryParams is parameters of getQuery operation.

type GetQueryRangeParams

type GetQueryRangeParams struct {
	// Prometheus expression query string.
	Query string
	// Start timestamp, inclusive.
	Start PrometheusTimestamp
	// End timestamp, inclusive.
	End PrometheusTimestamp
	// Query resolution step width in duration format or float number of seconds.
	Step string
	// Lookback delta duration in duration format or float number of seconds.
	LookbackDelta OptString
	// Statistics to return.
	Stats OptString
}

GetQueryRangeParams is parameters of getQueryRange operation.

type GetRulesParams

type GetRulesParams struct {
	// Return only the alerting rules (e.g. type=alert) or the recording rules (e.g. type=record).
	// When the parameter is absent or empty, no filtering is done.
	Type OptGetRulesType
	// Only return rules with the given rule name.
	// If the parameter is repeated, rules with any of the provided names are returned.
	// If we've filtered out all the rules of a group, the group is not returned.
	// When the parameter is absent or empty, no filtering is done.
	RuleName []string
	// Only return rules with the given rule group name.
	// If the parameter is repeated, rules with any of the provided rule group names are returned.
	// When the parameter is absent or empty, no filtering is done.
	RuleGroup []string
	// Only return rules with the given filepath.
	// If the parameter is repeated, rules with any of the provided filepaths are returned.
	// When the parameter is absent or empty, no filtering is done.
	File []string
}

GetRulesParams is parameters of getRules operation.

type GetRulesType

type GetRulesType string
const (
	GetRulesTypeAlert  GetRulesType = "alert"
	GetRulesTypeRecord GetRulesType = "record"
)

func (GetRulesType) AllValues added in v0.1.0

func (GetRulesType) AllValues() []GetRulesType

AllValues returns all GetRulesType values.

func (GetRulesType) MarshalText

func (s GetRulesType) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*GetRulesType) UnmarshalText

func (s *GetRulesType) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (GetRulesType) Validate

func (s GetRulesType) Validate() error

type GetSeriesParams

type GetSeriesParams struct {
	// Start timestamp.
	Start OptPrometheusTimestamp
	// End timestamp.
	End OptPrometheusTimestamp
	// Repeated series selector argument that selects the series from which to read the label names.
	Match []string
}

GetSeriesParams is parameters of getSeries operation.

type HPoint added in v0.1.0

type HPoint struct {
	T  float64
	V1 Histogram
}

Ref: #/components/schemas/HPoint

func (*HPoint) Decode added in v0.1.0

func (s *HPoint) Decode(d *jx.Decoder) error

Decode decodes HPoint from json.

func (*HPoint) Encode added in v0.1.0

func (s *HPoint) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*HPoint) GetT added in v0.1.0

func (s *HPoint) GetT() float64

GetT returns the value of T.

func (*HPoint) GetV1 added in v0.1.0

func (s *HPoint) GetV1() Histogram

GetV1 returns the value of V1.

func (*HPoint) MarshalJSON added in v0.1.0

func (s *HPoint) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*HPoint) SetFake added in v0.1.0

func (s *HPoint) SetFake()

SetFake set fake values.

func (*HPoint) SetT added in v0.1.0

func (s *HPoint) SetT(val float64)

SetT sets the value of T.

func (*HPoint) SetV1 added in v0.1.0

func (s *HPoint) SetV1(val Histogram)

SetV1 sets the value of V1.

func (*HPoint) UnmarshalJSON added in v0.1.0

func (s *HPoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*HPoint) Validate added in v0.1.0

func (s *HPoint) Validate() error

type Handler

type Handler interface {
	// GetLabelValues implements getLabelValues operation.
	//
	// GET /api/v1/label/{label}/values
	GetLabelValues(ctx context.Context, params GetLabelValuesParams) (*LabelValuesResponse, error)
	// GetLabels implements getLabels operation.
	//
	// GET /api/v1/labels
	GetLabels(ctx context.Context, params GetLabelsParams) (*LabelsResponse, error)
	// GetMetadata implements getMetadata operation.
	//
	// GET /api/v1/metadata
	GetMetadata(ctx context.Context, params GetMetadataParams) (*MetadataResponse, error)
	// GetQuery implements getQuery operation.
	//
	// Query Prometheus.
	//
	// GET /api/v1/query
	GetQuery(ctx context.Context, params GetQueryParams) (*QueryResponse, error)
	// GetQueryExemplars implements getQueryExemplars operation.
	//
	// Query Prometheus.
	//
	// GET /api/v1/query_exemplars
	GetQueryExemplars(ctx context.Context, params GetQueryExemplarsParams) (*QueryExemplarsResponse, error)
	// GetQueryRange implements getQueryRange operation.
	//
	// Query Prometheus.
	//
	// GET /api/v1/query_range
	GetQueryRange(ctx context.Context, params GetQueryRangeParams) (*QueryResponse, error)
	// GetRules implements getRules operation.
	//
	// GET /api/v1/rules
	GetRules(ctx context.Context, params GetRulesParams) (*RulesResponse, error)
	// GetSeries implements getSeries operation.
	//
	// Query Prometheus.
	//
	// GET /api/v1/series
	GetSeries(ctx context.Context, params GetSeriesParams) (*SeriesResponse, error)
	// PostLabels implements postLabels operation.
	//
	// POST /api/v1/labels
	PostLabels(ctx context.Context, req *LabelsForm) (*LabelsResponse, error)
	// PostQuery implements postQuery operation.
	//
	// Query Prometheus.
	//
	// POST /api/v1/query
	PostQuery(ctx context.Context, req *QueryForm) (*QueryResponse, error)
	// PostQueryExemplars implements postQueryExemplars operation.
	//
	// Query Prometheus.
	//
	// POST /api/v1/query_exemplars
	PostQueryExemplars(ctx context.Context, req *ExemplarsForm) (*QueryExemplarsResponse, error)
	// PostQueryRange implements postQueryRange operation.
	//
	// Query Prometheus.
	//
	// POST /api/v1/query_range
	PostQueryRange(ctx context.Context, req *QueryRangeForm) (*QueryResponse, error)
	// PostSeries implements postSeries operation.
	//
	// Query Prometheus.
	//
	// POST /api/v1/series
	PostSeries(ctx context.Context, req *SeriesForm) (*SeriesResponse, error)
	// NewError creates *FailStatusCode from error returned by handler.
	//
	// Used for common default response.
	NewError(ctx context.Context, err error) *FailStatusCode
}

Handler handles operations described by OpenAPI v3 specification.

type Histogram added in v0.1.0

type Histogram struct {
	Count   float64  `json:"count"`
	Sum     float64  `json:"sum"`
	Buckets []Bucket `json:"buckets"`
}

Ref: #/components/schemas/Histogram

func (*Histogram) Decode added in v0.1.0

func (s *Histogram) Decode(d *jx.Decoder) error

Decode decodes Histogram from json.

func (*Histogram) Encode added in v0.1.0

func (s *Histogram) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Histogram) GetBuckets added in v0.1.0

func (s *Histogram) GetBuckets() []Bucket

GetBuckets returns the value of Buckets.

func (*Histogram) GetCount added in v0.1.0

func (s *Histogram) GetCount() float64

GetCount returns the value of Count.

func (*Histogram) GetSum added in v0.1.0

func (s *Histogram) GetSum() float64

GetSum returns the value of Sum.

func (*Histogram) MarshalJSON added in v0.1.0

func (s *Histogram) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Histogram) SetBuckets added in v0.1.0

func (s *Histogram) SetBuckets(val []Bucket)

SetBuckets sets the value of Buckets.

func (*Histogram) SetCount added in v0.1.0

func (s *Histogram) SetCount(val float64)

SetCount sets the value of Count.

func (*Histogram) SetFake added in v0.1.0

func (s *Histogram) SetFake()

SetFake set fake values.

func (*Histogram) SetSum added in v0.1.0

func (s *Histogram) SetSum(val float64)

SetSum sets the value of Sum.

func (*Histogram) UnmarshalJSON added in v0.1.0

func (s *Histogram) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Histogram) Validate added in v0.1.0

func (s *Histogram) Validate() error

type HistogramOrValue added in v0.1.0

type HistogramOrValue struct {
	Type          HistogramOrValueType // switch on this field
	Histogram     Histogram
	StringFloat64 float64
}

HistogramOrValue represents sum type.

func NewHistogramHistogramOrValue added in v0.1.0

func NewHistogramHistogramOrValue(v Histogram) HistogramOrValue

NewHistogramHistogramOrValue returns new HistogramOrValue from Histogram.

func NewStringFloat64HistogramOrValue added in v0.2.0

func NewStringFloat64HistogramOrValue(v float64) HistogramOrValue

NewStringFloat64HistogramOrValue returns new HistogramOrValue from float64.

func (*HistogramOrValue) Decode added in v0.1.0

func (s *HistogramOrValue) Decode(d *jx.Decoder) error

Decode decodes HistogramOrValue from json.

func (HistogramOrValue) Encode added in v0.1.0

func (s HistogramOrValue) Encode(e *jx.Encoder)

Encode encodes HistogramOrValue as json.

func (HistogramOrValue) GetHistogram added in v0.1.0

func (s HistogramOrValue) GetHistogram() (v Histogram, ok bool)

GetHistogram returns Histogram and true boolean if HistogramOrValue is Histogram.

func (HistogramOrValue) GetStringFloat64 added in v0.2.0

func (s HistogramOrValue) GetStringFloat64() (v float64, ok bool)

GetStringFloat64 returns float64 and true boolean if HistogramOrValue is float64.

func (HistogramOrValue) IsHistogram added in v0.1.0

func (s HistogramOrValue) IsHistogram() bool

IsHistogram reports whether HistogramOrValue is Histogram.

func (HistogramOrValue) IsStringFloat64 added in v0.2.0

func (s HistogramOrValue) IsStringFloat64() bool

IsStringFloat64 reports whether HistogramOrValue is float64.

func (HistogramOrValue) MarshalJSON added in v0.1.0

func (s HistogramOrValue) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*HistogramOrValue) SetFake added in v0.1.0

func (s *HistogramOrValue) SetFake()

SetFake set fake values.

func (*HistogramOrValue) SetHistogram added in v0.1.0

func (s *HistogramOrValue) SetHistogram(v Histogram)

SetHistogram sets HistogramOrValue to Histogram.

func (*HistogramOrValue) SetStringFloat64 added in v0.2.0

func (s *HistogramOrValue) SetStringFloat64(v float64)

SetStringFloat64 sets HistogramOrValue to float64.

func (*HistogramOrValue) UnmarshalJSON added in v0.1.0

func (s *HistogramOrValue) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (HistogramOrValue) Validate added in v0.1.0

func (s HistogramOrValue) Validate() error

type HistogramOrValueType added in v0.1.0

type HistogramOrValueType string

HistogramOrValueType is oneOf type of HistogramOrValue.

const (
	HistogramHistogramOrValue     HistogramOrValueType = "Histogram"
	StringFloat64HistogramOrValue HistogramOrValueType = "float64"
)

Possible values for HistogramOrValueType.

type Invoker added in v0.1.0

type Invoker interface {
	// GetLabelValues invokes getLabelValues operation.
	//
	// GET /api/v1/label/{label}/values
	GetLabelValues(ctx context.Context, params GetLabelValuesParams) (*LabelValuesResponse, error)
	// GetLabels invokes getLabels operation.
	//
	// GET /api/v1/labels
	GetLabels(ctx context.Context, params GetLabelsParams) (*LabelsResponse, error)
	// GetMetadata invokes getMetadata operation.
	//
	// GET /api/v1/metadata
	GetMetadata(ctx context.Context, params GetMetadataParams) (*MetadataResponse, error)
	// GetQuery invokes getQuery operation.
	//
	// Query Prometheus.
	//
	// GET /api/v1/query
	GetQuery(ctx context.Context, params GetQueryParams) (*QueryResponse, error)
	// GetQueryExemplars invokes getQueryExemplars operation.
	//
	// Query Prometheus.
	//
	// GET /api/v1/query_exemplars
	GetQueryExemplars(ctx context.Context, params GetQueryExemplarsParams) (*QueryExemplarsResponse, error)
	// GetQueryRange invokes getQueryRange operation.
	//
	// Query Prometheus.
	//
	// GET /api/v1/query_range
	GetQueryRange(ctx context.Context, params GetQueryRangeParams) (*QueryResponse, error)
	// GetRules invokes getRules operation.
	//
	// GET /api/v1/rules
	GetRules(ctx context.Context, params GetRulesParams) (*RulesResponse, error)
	// GetSeries invokes getSeries operation.
	//
	// Query Prometheus.
	//
	// GET /api/v1/series
	GetSeries(ctx context.Context, params GetSeriesParams) (*SeriesResponse, error)
	// PostLabels invokes postLabels operation.
	//
	// POST /api/v1/labels
	PostLabels(ctx context.Context, request *LabelsForm) (*LabelsResponse, error)
	// PostQuery invokes postQuery operation.
	//
	// Query Prometheus.
	//
	// POST /api/v1/query
	PostQuery(ctx context.Context, request *QueryForm) (*QueryResponse, error)
	// PostQueryExemplars invokes postQueryExemplars operation.
	//
	// Query Prometheus.
	//
	// POST /api/v1/query_exemplars
	PostQueryExemplars(ctx context.Context, request *ExemplarsForm) (*QueryExemplarsResponse, error)
	// PostQueryRange invokes postQueryRange operation.
	//
	// Query Prometheus.
	//
	// POST /api/v1/query_range
	PostQueryRange(ctx context.Context, request *QueryRangeForm) (*QueryResponse, error)
	// PostSeries invokes postSeries operation.
	//
	// Query Prometheus.
	//
	// POST /api/v1/series
	PostSeries(ctx context.Context, request *SeriesForm) (*SeriesResponse, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type LabelSet

type LabelSet map[string]string

Ref: #/components/schemas/LabelSet

func (*LabelSet) Decode

func (s *LabelSet) Decode(d *jx.Decoder) error

Decode decodes LabelSet from json.

func (LabelSet) Encode

func (s LabelSet) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (LabelSet) MarshalJSON

func (s LabelSet) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LabelSet) SetFake

func (s *LabelSet) SetFake()

SetFake set fake values.

func (*LabelSet) UnmarshalJSON

func (s *LabelSet) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type LabelValues

type LabelValues []string

func (*LabelValues) Decode

func (s *LabelValues) Decode(d *jx.Decoder) error

Decode decodes LabelValues from json.

func (LabelValues) Encode

func (s LabelValues) Encode(e *jx.Encoder)

Encode encodes LabelValues as json.

func (LabelValues) MarshalJSON

func (s LabelValues) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LabelValues) SetFake

func (s *LabelValues) SetFake()

SetFake set fake values.

func (*LabelValues) UnmarshalJSON

func (s *LabelValues) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (LabelValues) Validate

func (s LabelValues) Validate() error

type LabelValuesResponse

type LabelValuesResponse struct {
	// Always 'success'.
	Status string `json:"status"`
	// Only if there were warnings while executing the request. There will still be data in the data
	// field.
	Warnings []string    `json:"warnings"`
	Data     LabelValues `json:"data"`
}

func (*LabelValuesResponse) Decode

func (s *LabelValuesResponse) Decode(d *jx.Decoder) error

Decode decodes LabelValuesResponse from json.

func (*LabelValuesResponse) Encode

func (s *LabelValuesResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*LabelValuesResponse) GetData

func (s *LabelValuesResponse) GetData() LabelValues

GetData returns the value of Data.

func (*LabelValuesResponse) GetStatus

func (s *LabelValuesResponse) GetStatus() string

GetStatus returns the value of Status.

func (*LabelValuesResponse) GetWarnings

func (s *LabelValuesResponse) GetWarnings() []string

GetWarnings returns the value of Warnings.

func (*LabelValuesResponse) MarshalJSON

func (s *LabelValuesResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LabelValuesResponse) SetData

func (s *LabelValuesResponse) SetData(val LabelValues)

SetData sets the value of Data.

func (*LabelValuesResponse) SetFake

func (s *LabelValuesResponse) SetFake()

SetFake set fake values.

func (*LabelValuesResponse) SetStatus

func (s *LabelValuesResponse) SetStatus(val string)

SetStatus sets the value of Status.

func (*LabelValuesResponse) SetWarnings

func (s *LabelValuesResponse) SetWarnings(val []string)

SetWarnings sets the value of Warnings.

func (*LabelValuesResponse) UnmarshalJSON

func (s *LabelValuesResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*LabelValuesResponse) Validate

func (s *LabelValuesResponse) Validate() error

type Labels

type Labels []string

func (*Labels) Decode

func (s *Labels) Decode(d *jx.Decoder) error

Decode decodes Labels from json.

func (Labels) Encode

func (s Labels) Encode(e *jx.Encoder)

Encode encodes Labels as json.

func (Labels) MarshalJSON

func (s Labels) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Labels) SetFake

func (s *Labels) SetFake()

SetFake set fake values.

func (*Labels) UnmarshalJSON

func (s *Labels) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (Labels) Validate

func (s Labels) Validate() error

type LabelsForm added in v0.1.0

type LabelsForm struct {
	Start OptPrometheusTimestamp `json:"start"`
	End   OptPrometheusTimestamp `json:"end"`
	Match []string               `json:"match[]"`
}

Ref: #/components/schemas/LabelsForm

func (*LabelsForm) GetEnd added in v0.1.0

func (s *LabelsForm) GetEnd() OptPrometheusTimestamp

GetEnd returns the value of End.

func (*LabelsForm) GetMatch added in v0.1.0

func (s *LabelsForm) GetMatch() []string

GetMatch returns the value of Match.

func (*LabelsForm) GetStart added in v0.1.0

func (s *LabelsForm) GetStart() OptPrometheusTimestamp

GetStart returns the value of Start.

func (*LabelsForm) SetEnd added in v0.1.0

func (s *LabelsForm) SetEnd(val OptPrometheusTimestamp)

SetEnd sets the value of End.

func (*LabelsForm) SetMatch added in v0.1.0

func (s *LabelsForm) SetMatch(val []string)

SetMatch sets the value of Match.

func (*LabelsForm) SetStart added in v0.1.0

func (s *LabelsForm) SetStart(val OptPrometheusTimestamp)

SetStart sets the value of Start.

type LabelsResponse

type LabelsResponse struct {
	// Always 'success'.
	Status string `json:"status"`
	// Only if there were warnings while executing the request. There will still be data in the data
	// field.
	Warnings []string `json:"warnings"`
	Data     Labels   `json:"data"`
}

func (*LabelsResponse) Decode

func (s *LabelsResponse) Decode(d *jx.Decoder) error

Decode decodes LabelsResponse from json.

func (*LabelsResponse) Encode

func (s *LabelsResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*LabelsResponse) GetData

func (s *LabelsResponse) GetData() Labels

GetData returns the value of Data.

func (*LabelsResponse) GetStatus

func (s *LabelsResponse) GetStatus() string

GetStatus returns the value of Status.

func (*LabelsResponse) GetWarnings

func (s *LabelsResponse) GetWarnings() []string

GetWarnings returns the value of Warnings.

func (*LabelsResponse) MarshalJSON

func (s *LabelsResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LabelsResponse) SetData

func (s *LabelsResponse) SetData(val Labels)

SetData sets the value of Data.

func (*LabelsResponse) SetFake

func (s *LabelsResponse) SetFake()

SetFake set fake values.

func (*LabelsResponse) SetStatus

func (s *LabelsResponse) SetStatus(val string)

SetStatus sets the value of Status.

func (*LabelsResponse) SetWarnings

func (s *LabelsResponse) SetWarnings(val []string)

SetWarnings sets the value of Warnings.

func (*LabelsResponse) UnmarshalJSON

func (s *LabelsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*LabelsResponse) Validate

func (s *LabelsResponse) Validate() error

type Matrix

type Matrix struct {
	Result []MatrixResultItem `json:"result"`
}

Ref: #/components/schemas/Matrix

func (*Matrix) Decode

func (s *Matrix) Decode(d *jx.Decoder) error

Decode decodes Matrix from json.

func (*Matrix) Encode

func (s *Matrix) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Matrix) GetResult

func (s *Matrix) GetResult() []MatrixResultItem

GetResult returns the value of Result.

func (*Matrix) MarshalJSON

func (s *Matrix) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Matrix) SetFake

func (s *Matrix) SetFake()

SetFake set fake values.

func (*Matrix) SetResult

func (s *Matrix) SetResult(val []MatrixResultItem)

SetResult sets the value of Result.

func (*Matrix) UnmarshalJSON

func (s *Matrix) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Matrix) Validate

func (s *Matrix) Validate() error

type MatrixResultItem

type MatrixResultItem struct {
	Metric     MatrixResultItemMetric `json:"metric"`
	Values     []FPoint               `json:"values"`
	Histograms []HPoint               `json:"histograms"`
}

func (*MatrixResultItem) Decode

func (s *MatrixResultItem) Decode(d *jx.Decoder) error

Decode decodes MatrixResultItem from json.

func (*MatrixResultItem) Encode

func (s *MatrixResultItem) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*MatrixResultItem) GetHistograms added in v0.1.0

func (s *MatrixResultItem) GetHistograms() []HPoint

GetHistograms returns the value of Histograms.

func (*MatrixResultItem) GetMetric

GetMetric returns the value of Metric.

func (*MatrixResultItem) GetValues

func (s *MatrixResultItem) GetValues() []FPoint

GetValues returns the value of Values.

func (*MatrixResultItem) MarshalJSON

func (s *MatrixResultItem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MatrixResultItem) SetFake

func (s *MatrixResultItem) SetFake()

SetFake set fake values.

func (*MatrixResultItem) SetHistograms added in v0.1.0

func (s *MatrixResultItem) SetHistograms(val []HPoint)

SetHistograms sets the value of Histograms.

func (*MatrixResultItem) SetMetric

func (s *MatrixResultItem) SetMetric(val MatrixResultItemMetric)

SetMetric sets the value of Metric.

func (*MatrixResultItem) SetValues

func (s *MatrixResultItem) SetValues(val []FPoint)

SetValues sets the value of Values.

func (*MatrixResultItem) UnmarshalJSON

func (s *MatrixResultItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MatrixResultItem) Validate

func (s *MatrixResultItem) Validate() error

type MatrixResultItemMetric

type MatrixResultItemMetric map[string]string

func (*MatrixResultItemMetric) Decode

func (s *MatrixResultItemMetric) Decode(d *jx.Decoder) error

Decode decodes MatrixResultItemMetric from json.

func (MatrixResultItemMetric) Encode

func (s MatrixResultItemMetric) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (MatrixResultItemMetric) MarshalJSON

func (s MatrixResultItemMetric) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MatrixResultItemMetric) SetFake

func (s *MatrixResultItemMetric) SetFake()

SetFake set fake values.

func (*MatrixResultItemMetric) UnmarshalJSON

func (s *MatrixResultItemMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Metadata

type Metadata map[string][]MetricMetadata

Ref: #/components/schemas/Metadata

func (*Metadata) Decode

func (s *Metadata) Decode(d *jx.Decoder) error

Decode decodes Metadata from json.

func (Metadata) Encode

func (s Metadata) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (Metadata) MarshalJSON

func (s Metadata) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Metadata) SetFake

func (s *Metadata) SetFake()

SetFake set fake values.

func (*Metadata) UnmarshalJSON

func (s *Metadata) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (Metadata) Validate

func (s Metadata) Validate() error

type MetadataResponse

type MetadataResponse struct {
	// Always 'success'.
	Status string `json:"status"`
	// Only if there were warnings while executing the request. There will still be data in the data
	// field.
	Warnings []string `json:"warnings"`
	Data     Metadata `json:"data"`
}

func (*MetadataResponse) Decode

func (s *MetadataResponse) Decode(d *jx.Decoder) error

Decode decodes MetadataResponse from json.

func (*MetadataResponse) Encode

func (s *MetadataResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*MetadataResponse) GetData

func (s *MetadataResponse) GetData() Metadata

GetData returns the value of Data.

func (*MetadataResponse) GetStatus

func (s *MetadataResponse) GetStatus() string

GetStatus returns the value of Status.

func (*MetadataResponse) GetWarnings

func (s *MetadataResponse) GetWarnings() []string

GetWarnings returns the value of Warnings.

func (*MetadataResponse) MarshalJSON

func (s *MetadataResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MetadataResponse) SetData

func (s *MetadataResponse) SetData(val Metadata)

SetData sets the value of Data.

func (*MetadataResponse) SetFake

func (s *MetadataResponse) SetFake()

SetFake set fake values.

func (*MetadataResponse) SetStatus

func (s *MetadataResponse) SetStatus(val string)

SetStatus sets the value of Status.

func (*MetadataResponse) SetWarnings

func (s *MetadataResponse) SetWarnings(val []string)

SetWarnings sets the value of Warnings.

func (*MetadataResponse) UnmarshalJSON

func (s *MetadataResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MetadataResponse) Validate

func (s *MetadataResponse) Validate() error

type MetricMetadata

type MetricMetadata struct {
	Type OptMetricMetadataType `json:"type"`
	Help OptString             `json:"help"`
	Unit OptString             `json:"unit"`
}

Ref: #/components/schemas/MetricMetadata

func (*MetricMetadata) Decode

func (s *MetricMetadata) Decode(d *jx.Decoder) error

Decode decodes MetricMetadata from json.

func (*MetricMetadata) Encode

func (s *MetricMetadata) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*MetricMetadata) GetHelp

func (s *MetricMetadata) GetHelp() OptString

GetHelp returns the value of Help.

func (*MetricMetadata) GetType

GetType returns the value of Type.

func (*MetricMetadata) GetUnit

func (s *MetricMetadata) GetUnit() OptString

GetUnit returns the value of Unit.

func (*MetricMetadata) MarshalJSON

func (s *MetricMetadata) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MetricMetadata) SetFake

func (s *MetricMetadata) SetFake()

SetFake set fake values.

func (*MetricMetadata) SetHelp

func (s *MetricMetadata) SetHelp(val OptString)

SetHelp sets the value of Help.

func (*MetricMetadata) SetType

func (s *MetricMetadata) SetType(val OptMetricMetadataType)

SetType sets the value of Type.

func (*MetricMetadata) SetUnit

func (s *MetricMetadata) SetUnit(val OptString)

SetUnit sets the value of Unit.

func (*MetricMetadata) UnmarshalJSON

func (s *MetricMetadata) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MetricMetadata) Validate

func (s *MetricMetadata) Validate() error

type MetricMetadataType

type MetricMetadataType string
const (
	MetricMetadataTypeCounter        MetricMetadataType = "counter"
	MetricMetadataTypeGauge          MetricMetadataType = "gauge"
	MetricMetadataTypeHistogram      MetricMetadataType = "histogram"
	MetricMetadataTypeGaugehistogram MetricMetadataType = "gaugehistogram"
	MetricMetadataTypeSummary        MetricMetadataType = "summary"
	MetricMetadataTypeInfo           MetricMetadataType = "info"
	MetricMetadataTypeStateset       MetricMetadataType = "stateset"
	MetricMetadataTypeUnknown        MetricMetadataType = "unknown"
)

func (MetricMetadataType) AllValues added in v0.1.0

func (MetricMetadataType) AllValues() []MetricMetadataType

AllValues returns all MetricMetadataType values.

func (*MetricMetadataType) Decode

func (s *MetricMetadataType) Decode(d *jx.Decoder) error

Decode decodes MetricMetadataType from json.

func (MetricMetadataType) Encode

func (s MetricMetadataType) Encode(e *jx.Encoder)

Encode encodes MetricMetadataType as json.

func (MetricMetadataType) MarshalJSON

func (s MetricMetadataType) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (MetricMetadataType) MarshalText

func (s MetricMetadataType) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*MetricMetadataType) SetFake

func (s *MetricMetadataType) SetFake()

SetFake set fake values.

func (*MetricMetadataType) UnmarshalJSON

func (s *MetricMetadataType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MetricMetadataType) UnmarshalText

func (s *MetricMetadataType) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (MetricMetadataType) Validate

func (s MetricMetadataType) Validate() error

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OptAlertingRuleState

type OptAlertingRuleState struct {
	Value AlertingRuleState
	Set   bool
}

OptAlertingRuleState is optional AlertingRuleState.

func NewOptAlertingRuleState

func NewOptAlertingRuleState(v AlertingRuleState) OptAlertingRuleState

NewOptAlertingRuleState returns new OptAlertingRuleState with value set to v.

func (*OptAlertingRuleState) Decode

func (o *OptAlertingRuleState) Decode(d *jx.Decoder) error

Decode decodes AlertingRuleState from json.

func (OptAlertingRuleState) Encode

func (o OptAlertingRuleState) Encode(e *jx.Encoder)

Encode encodes AlertingRuleState as json.

func (OptAlertingRuleState) Get

Get returns value and boolean that denotes whether value was set.

func (OptAlertingRuleState) IsSet

func (o OptAlertingRuleState) IsSet() bool

IsSet returns true if OptAlertingRuleState was set.

func (OptAlertingRuleState) MarshalJSON

func (s OptAlertingRuleState) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptAlertingRuleState) Or

Or returns value if set, or given parameter if does not.

func (*OptAlertingRuleState) Reset

func (o *OptAlertingRuleState) Reset()

Reset unsets value.

func (*OptAlertingRuleState) SetFake

func (s *OptAlertingRuleState) SetFake()

SetFake set fake values.

func (*OptAlertingRuleState) SetTo

SetTo sets value to v.

func (*OptAlertingRuleState) UnmarshalJSON

func (s *OptAlertingRuleState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptData

type OptData struct {
	Value Data
	Set   bool
}

OptData is optional Data.

func NewOptData

func NewOptData(v Data) OptData

NewOptData returns new OptData with value set to v.

func (*OptData) Decode

func (o *OptData) Decode(d *jx.Decoder) error

Decode decodes Data from json.

func (OptData) Encode

func (o OptData) Encode(e *jx.Encoder)

Encode encodes Data as json.

func (OptData) Get

func (o OptData) Get() (v Data, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptData) IsSet

func (o OptData) IsSet() bool

IsSet returns true if OptData was set.

func (OptData) MarshalJSON

func (s OptData) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptData) Or

func (o OptData) Or(d Data) Data

Or returns value if set, or given parameter if does not.

func (*OptData) Reset

func (o *OptData) Reset()

Reset unsets value.

func (*OptData) SetFake

func (s *OptData) SetFake()

SetFake set fake values.

func (*OptData) SetTo

func (o *OptData) SetTo(v Data)

SetTo sets value to v.

func (*OptData) UnmarshalJSON

func (s *OptData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptDateTime

type OptDateTime struct {
	Value time.Time
	Set   bool
}

OptDateTime is optional time.Time.

func NewOptDateTime

func NewOptDateTime(v time.Time) OptDateTime

NewOptDateTime returns new OptDateTime with value set to v.

func (*OptDateTime) Decode

func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error

Decode decodes time.Time from json.

func (OptDateTime) Encode

func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))

Encode encodes time.Time as json.

func (OptDateTime) Get

func (o OptDateTime) Get() (v time.Time, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptDateTime) IsSet

func (o OptDateTime) IsSet() bool

IsSet returns true if OptDateTime was set.

func (OptDateTime) MarshalJSON

func (s OptDateTime) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptDateTime) Or

func (o OptDateTime) Or(d time.Time) time.Time

Or returns value if set, or given parameter if does not.

func (*OptDateTime) Reset

func (o *OptDateTime) Reset()

Reset unsets value.

func (*OptDateTime) SetFake

func (s *OptDateTime) SetFake()

SetFake set fake values.

func (*OptDateTime) SetTo

func (o *OptDateTime) SetTo(v time.Time)

SetTo sets value to v.

func (*OptDateTime) UnmarshalJSON

func (s *OptDateTime) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptFloat64

type OptFloat64 struct {
	Value float64
	Set   bool
}

OptFloat64 is optional float64.

func NewOptFloat64

func NewOptFloat64(v float64) OptFloat64

NewOptFloat64 returns new OptFloat64 with value set to v.

func (*OptFloat64) Decode

func (o *OptFloat64) Decode(d *jx.Decoder) error

Decode decodes float64 from json.

func (OptFloat64) Encode

func (o OptFloat64) Encode(e *jx.Encoder)

Encode encodes float64 as json.

func (OptFloat64) Get

func (o OptFloat64) Get() (v float64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptFloat64) IsSet

func (o OptFloat64) IsSet() bool

IsSet returns true if OptFloat64 was set.

func (OptFloat64) MarshalJSON

func (s OptFloat64) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptFloat64) Or

func (o OptFloat64) Or(d float64) float64

Or returns value if set, or given parameter if does not.

func (*OptFloat64) Reset

func (o *OptFloat64) Reset()

Reset unsets value.

func (*OptFloat64) SetFake

func (s *OptFloat64) SetFake()

SetFake set fake values.

func (*OptFloat64) SetTo

func (o *OptFloat64) SetTo(v float64)

SetTo sets value to v.

func (*OptFloat64) UnmarshalJSON

func (s *OptFloat64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptGetRulesType

type OptGetRulesType struct {
	Value GetRulesType
	Set   bool
}

OptGetRulesType is optional GetRulesType.

func NewOptGetRulesType

func NewOptGetRulesType(v GetRulesType) OptGetRulesType

NewOptGetRulesType returns new OptGetRulesType with value set to v.

func (OptGetRulesType) Get

func (o OptGetRulesType) Get() (v GetRulesType, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptGetRulesType) IsSet

func (o OptGetRulesType) IsSet() bool

IsSet returns true if OptGetRulesType was set.

func (OptGetRulesType) Or

Or returns value if set, or given parameter if does not.

func (*OptGetRulesType) Reset

func (o *OptGetRulesType) Reset()

Reset unsets value.

func (*OptGetRulesType) SetTo

func (o *OptGetRulesType) SetTo(v GetRulesType)

SetTo sets value to v.

type OptInt

type OptInt struct {
	Value int
	Set   bool
}

OptInt is optional int.

func NewOptInt

func NewOptInt(v int) OptInt

NewOptInt returns new OptInt with value set to v.

func (*OptInt) Decode

func (o *OptInt) Decode(d *jx.Decoder) error

Decode decodes int from json.

func (OptInt) Encode

func (o OptInt) Encode(e *jx.Encoder)

Encode encodes int as json.

func (OptInt) Get

func (o OptInt) Get() (v int, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt) IsSet

func (o OptInt) IsSet() bool

IsSet returns true if OptInt was set.

func (OptInt) MarshalJSON

func (s OptInt) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptInt) Or

func (o OptInt) Or(d int) int

Or returns value if set, or given parameter if does not.

func (*OptInt) Reset

func (o *OptInt) Reset()

Reset unsets value.

func (*OptInt) SetFake

func (s *OptInt) SetFake()

SetFake set fake values.

func (*OptInt) SetTo

func (o *OptInt) SetTo(v int)

SetTo sets value to v.

func (*OptInt) UnmarshalJSON

func (s *OptInt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLabelSet

type OptLabelSet struct {
	Value LabelSet
	Set   bool
}

OptLabelSet is optional LabelSet.

func NewOptLabelSet

func NewOptLabelSet(v LabelSet) OptLabelSet

NewOptLabelSet returns new OptLabelSet with value set to v.

func (*OptLabelSet) Decode

func (o *OptLabelSet) Decode(d *jx.Decoder) error

Decode decodes LabelSet from json.

func (OptLabelSet) Encode

func (o OptLabelSet) Encode(e *jx.Encoder)

Encode encodes LabelSet as json.

func (OptLabelSet) Get

func (o OptLabelSet) Get() (v LabelSet, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptLabelSet) IsSet

func (o OptLabelSet) IsSet() bool

IsSet returns true if OptLabelSet was set.

func (OptLabelSet) MarshalJSON

func (s OptLabelSet) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptLabelSet) Or

func (o OptLabelSet) Or(d LabelSet) LabelSet

Or returns value if set, or given parameter if does not.

func (*OptLabelSet) Reset

func (o *OptLabelSet) Reset()

Reset unsets value.

func (*OptLabelSet) SetFake

func (s *OptLabelSet) SetFake()

SetFake set fake values.

func (*OptLabelSet) SetTo

func (o *OptLabelSet) SetTo(v LabelSet)

SetTo sets value to v.

func (*OptLabelSet) UnmarshalJSON

func (s *OptLabelSet) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptMetricMetadataType

type OptMetricMetadataType struct {
	Value MetricMetadataType
	Set   bool
}

OptMetricMetadataType is optional MetricMetadataType.

func NewOptMetricMetadataType

func NewOptMetricMetadataType(v MetricMetadataType) OptMetricMetadataType

NewOptMetricMetadataType returns new OptMetricMetadataType with value set to v.

func (*OptMetricMetadataType) Decode

func (o *OptMetricMetadataType) Decode(d *jx.Decoder) error

Decode decodes MetricMetadataType from json.

func (OptMetricMetadataType) Encode

func (o OptMetricMetadataType) Encode(e *jx.Encoder)

Encode encodes MetricMetadataType as json.

func (OptMetricMetadataType) Get

Get returns value and boolean that denotes whether value was set.

func (OptMetricMetadataType) IsSet

func (o OptMetricMetadataType) IsSet() bool

IsSet returns true if OptMetricMetadataType was set.

func (OptMetricMetadataType) MarshalJSON

func (s OptMetricMetadataType) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptMetricMetadataType) Or

Or returns value if set, or given parameter if does not.

func (*OptMetricMetadataType) Reset

func (o *OptMetricMetadataType) Reset()

Reset unsets value.

func (*OptMetricMetadataType) SetFake

func (s *OptMetricMetadataType) SetFake()

SetFake set fake values.

func (*OptMetricMetadataType) SetTo

SetTo sets value to v.

func (*OptMetricMetadataType) UnmarshalJSON

func (s *OptMetricMetadataType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptPrometheusTimestamp

type OptPrometheusTimestamp struct {
	Value PrometheusTimestamp
	Set   bool
}

OptPrometheusTimestamp is optional PrometheusTimestamp.

func NewOptPrometheusTimestamp

func NewOptPrometheusTimestamp(v PrometheusTimestamp) OptPrometheusTimestamp

NewOptPrometheusTimestamp returns new OptPrometheusTimestamp with value set to v.

func (OptPrometheusTimestamp) Get

Get returns value and boolean that denotes whether value was set.

func (OptPrometheusTimestamp) IsSet

func (o OptPrometheusTimestamp) IsSet() bool

IsSet returns true if OptPrometheusTimestamp was set.

func (OptPrometheusTimestamp) Or

Or returns value if set, or given parameter if does not.

func (*OptPrometheusTimestamp) Reset

func (o *OptPrometheusTimestamp) Reset()

Reset unsets value.

func (*OptPrometheusTimestamp) SetTo

SetTo sets value to v.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON

func (s OptString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetFake

func (s *OptString) SetFake()

SetFake set fake values.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON

func (s *OptString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a meter provider to use for creating a meter.

If none is specified, the otel.GetMeterProvider() is used.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer.

If none is specified, the global provider is used.

type PrometheusTimestamp

type PrometheusTimestamp string

type QueryExemplarsResponse

type QueryExemplarsResponse struct {
	// Always 'success'.
	Status string `json:"status"`
	// Only if there were warnings while executing the request. There will still be data in the data
	// field.
	Warnings []string  `json:"warnings"`
	Data     Exemplars `json:"data"`
}

func (*QueryExemplarsResponse) Decode

func (s *QueryExemplarsResponse) Decode(d *jx.Decoder) error

Decode decodes QueryExemplarsResponse from json.

func (*QueryExemplarsResponse) Encode

func (s *QueryExemplarsResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*QueryExemplarsResponse) GetData

func (s *QueryExemplarsResponse) GetData() Exemplars

GetData returns the value of Data.

func (*QueryExemplarsResponse) GetStatus

func (s *QueryExemplarsResponse) GetStatus() string

GetStatus returns the value of Status.

func (*QueryExemplarsResponse) GetWarnings

func (s *QueryExemplarsResponse) GetWarnings() []string

GetWarnings returns the value of Warnings.

func (*QueryExemplarsResponse) MarshalJSON

func (s *QueryExemplarsResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*QueryExemplarsResponse) SetData

func (s *QueryExemplarsResponse) SetData(val Exemplars)

SetData sets the value of Data.

func (*QueryExemplarsResponse) SetFake

func (s *QueryExemplarsResponse) SetFake()

SetFake set fake values.

func (*QueryExemplarsResponse) SetStatus

func (s *QueryExemplarsResponse) SetStatus(val string)

SetStatus sets the value of Status.

func (*QueryExemplarsResponse) SetWarnings

func (s *QueryExemplarsResponse) SetWarnings(val []string)

SetWarnings sets the value of Warnings.

func (*QueryExemplarsResponse) UnmarshalJSON

func (s *QueryExemplarsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*QueryExemplarsResponse) Validate

func (s *QueryExemplarsResponse) Validate() error

type QueryForm

type QueryForm struct {
	Query         string                 `json:"query"`
	Time          OptPrometheusTimestamp `json:"time"`
	LookbackDelta OptString              `json:"lookback_delta"`
	Stats         OptString              `json:"stats"`
}

Ref: #/components/schemas/QueryForm

func (*QueryForm) GetLookbackDelta added in v0.1.0

func (s *QueryForm) GetLookbackDelta() OptString

GetLookbackDelta returns the value of LookbackDelta.

func (*QueryForm) GetQuery

func (s *QueryForm) GetQuery() string

GetQuery returns the value of Query.

func (*QueryForm) GetStats added in v0.1.0

func (s *QueryForm) GetStats() OptString

GetStats returns the value of Stats.

func (*QueryForm) GetTime

func (s *QueryForm) GetTime() OptPrometheusTimestamp

GetTime returns the value of Time.

func (*QueryForm) SetLookbackDelta added in v0.1.0

func (s *QueryForm) SetLookbackDelta(val OptString)

SetLookbackDelta sets the value of LookbackDelta.

func (*QueryForm) SetQuery

func (s *QueryForm) SetQuery(val string)

SetQuery sets the value of Query.

func (*QueryForm) SetStats added in v0.1.0

func (s *QueryForm) SetStats(val OptString)

SetStats sets the value of Stats.

func (*QueryForm) SetTime

func (s *QueryForm) SetTime(val OptPrometheusTimestamp)

SetTime sets the value of Time.

type QueryRangeForm

type QueryRangeForm struct {
	// Prometheus expression query string.
	Query string              `json:"query"`
	Start PrometheusTimestamp `json:"start"`
	End   PrometheusTimestamp `json:"end"`
	// Query resolution step width in duration format or float number of seconds.
	Step          string    `json:"step"`
	LookbackDelta OptString `json:"lookback_delta"`
	Stats         OptString `json:"stats"`
}

Ref: #/components/schemas/QueryRangeForm

func (*QueryRangeForm) GetEnd

func (s *QueryRangeForm) GetEnd() PrometheusTimestamp

GetEnd returns the value of End.

func (*QueryRangeForm) GetLookbackDelta added in v0.1.0

func (s *QueryRangeForm) GetLookbackDelta() OptString

GetLookbackDelta returns the value of LookbackDelta.

func (*QueryRangeForm) GetQuery

func (s *QueryRangeForm) GetQuery() string

GetQuery returns the value of Query.

func (*QueryRangeForm) GetStart

func (s *QueryRangeForm) GetStart() PrometheusTimestamp

GetStart returns the value of Start.

func (*QueryRangeForm) GetStats added in v0.1.0

func (s *QueryRangeForm) GetStats() OptString

GetStats returns the value of Stats.

func (*QueryRangeForm) GetStep

func (s *QueryRangeForm) GetStep() string

GetStep returns the value of Step.

func (*QueryRangeForm) SetEnd

func (s *QueryRangeForm) SetEnd(val PrometheusTimestamp)

SetEnd sets the value of End.

func (*QueryRangeForm) SetLookbackDelta added in v0.1.0

func (s *QueryRangeForm) SetLookbackDelta(val OptString)

SetLookbackDelta sets the value of LookbackDelta.

func (*QueryRangeForm) SetQuery

func (s *QueryRangeForm) SetQuery(val string)

SetQuery sets the value of Query.

func (*QueryRangeForm) SetStart

func (s *QueryRangeForm) SetStart(val PrometheusTimestamp)

SetStart sets the value of Start.

func (*QueryRangeForm) SetStats added in v0.1.0

func (s *QueryRangeForm) SetStats(val OptString)

SetStats sets the value of Stats.

func (*QueryRangeForm) SetStep

func (s *QueryRangeForm) SetStep(val string)

SetStep sets the value of Step.

type QueryResponse

type QueryResponse struct {
	// Always 'success'.
	Status string `json:"status"`
	// Only if there were warnings while executing the request. There will still be data in the data
	// field.
	Warnings []string `json:"warnings"`
	Data     Data     `json:"data"`
}

func (*QueryResponse) Decode

func (s *QueryResponse) Decode(d *jx.Decoder) error

Decode decodes QueryResponse from json.

func (*QueryResponse) Encode

func (s *QueryResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*QueryResponse) GetData

func (s *QueryResponse) GetData() Data

GetData returns the value of Data.

func (*QueryResponse) GetStatus

func (s *QueryResponse) GetStatus() string

GetStatus returns the value of Status.

func (*QueryResponse) GetWarnings

func (s *QueryResponse) GetWarnings() []string

GetWarnings returns the value of Warnings.

func (*QueryResponse) MarshalJSON

func (s *QueryResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*QueryResponse) SetData

func (s *QueryResponse) SetData(val Data)

SetData sets the value of Data.

func (*QueryResponse) SetFake

func (s *QueryResponse) SetFake()

SetFake set fake values.

func (*QueryResponse) SetStatus

func (s *QueryResponse) SetStatus(val string)

SetStatus sets the value of Status.

func (*QueryResponse) SetWarnings

func (s *QueryResponse) SetWarnings(val []string)

SetWarnings sets the value of Warnings.

func (*QueryResponse) UnmarshalJSON

func (s *QueryResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*QueryResponse) Validate

func (s *QueryResponse) Validate() error

type RecordingRule

type RecordingRule struct {
	Name           string     `json:"name"`
	Query          string     `json:"query"`
	Labels         LabelSet   `json:"labels"`
	Health         RuleHealth `json:"health"`
	LastError      string     `json:"lastError"`
	EvaluationTime time.Time  `json:"evaluationTime"`
	LastEvaluation float64    `json:"lastEvaluation"`
}

Ref: #/components/schemas/RecordingRule

func (*RecordingRule) Decode

func (s *RecordingRule) Decode(d *jx.Decoder) error

Decode decodes RecordingRule from json.

func (*RecordingRule) Encode

func (s *RecordingRule) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*RecordingRule) GetEvaluationTime

func (s *RecordingRule) GetEvaluationTime() time.Time

GetEvaluationTime returns the value of EvaluationTime.

func (*RecordingRule) GetHealth

func (s *RecordingRule) GetHealth() RuleHealth

GetHealth returns the value of Health.

func (*RecordingRule) GetLabels

func (s *RecordingRule) GetLabels() LabelSet

GetLabels returns the value of Labels.

func (*RecordingRule) GetLastError

func (s *RecordingRule) GetLastError() string

GetLastError returns the value of LastError.

func (*RecordingRule) GetLastEvaluation

func (s *RecordingRule) GetLastEvaluation() float64

GetLastEvaluation returns the value of LastEvaluation.

func (*RecordingRule) GetName

func (s *RecordingRule) GetName() string

GetName returns the value of Name.

func (*RecordingRule) GetQuery

func (s *RecordingRule) GetQuery() string

GetQuery returns the value of Query.

func (*RecordingRule) MarshalJSON

func (s *RecordingRule) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RecordingRule) SetEvaluationTime

func (s *RecordingRule) SetEvaluationTime(val time.Time)

SetEvaluationTime sets the value of EvaluationTime.

func (*RecordingRule) SetFake

func (s *RecordingRule) SetFake()

SetFake set fake values.

func (*RecordingRule) SetHealth

func (s *RecordingRule) SetHealth(val RuleHealth)

SetHealth sets the value of Health.

func (*RecordingRule) SetLabels

func (s *RecordingRule) SetLabels(val LabelSet)

SetLabels sets the value of Labels.

func (*RecordingRule) SetLastError

func (s *RecordingRule) SetLastError(val string)

SetLastError sets the value of LastError.

func (*RecordingRule) SetLastEvaluation

func (s *RecordingRule) SetLastEvaluation(val float64)

SetLastEvaluation sets the value of LastEvaluation.

func (*RecordingRule) SetName

func (s *RecordingRule) SetName(val string)

SetName sets the value of Name.

func (*RecordingRule) SetQuery

func (s *RecordingRule) SetQuery(val string)

SetQuery sets the value of Query.

func (*RecordingRule) UnmarshalJSON

func (s *RecordingRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RecordingRule) Validate

func (s *RecordingRule) Validate() error

type Route

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

Route is route object.

func (Route) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

func (Route) Summary added in v0.1.0

func (r Route) Summary() string

Summary returns OpenAPI summary.

type Rule

type Rule struct {
	Type          RuleType // switch on this field
	AlertingRule  AlertingRule
	RecordingRule RecordingRule
}

Ref: #/components/schemas/Rule Rule represents sum type.

func NewAlertingRuleRule

func NewAlertingRuleRule(v AlertingRule) Rule

NewAlertingRuleRule returns new Rule from AlertingRule.

func NewRecordingRuleRule

func NewRecordingRuleRule(v RecordingRule) Rule

NewRecordingRuleRule returns new Rule from RecordingRule.

func (*Rule) Decode

func (s *Rule) Decode(d *jx.Decoder) error

Decode decodes Rule from json.

func (Rule) Encode

func (s Rule) Encode(e *jx.Encoder)

Encode encodes Rule as json.

func (Rule) GetAlertingRule

func (s Rule) GetAlertingRule() (v AlertingRule, ok bool)

GetAlertingRule returns AlertingRule and true boolean if Rule is AlertingRule.

func (Rule) GetRecordingRule

func (s Rule) GetRecordingRule() (v RecordingRule, ok bool)

GetRecordingRule returns RecordingRule and true boolean if Rule is RecordingRule.

func (Rule) IsAlertingRule

func (s Rule) IsAlertingRule() bool

IsAlertingRule reports whether Rule is AlertingRule.

func (Rule) IsRecordingRule

func (s Rule) IsRecordingRule() bool

IsRecordingRule reports whether Rule is RecordingRule.

func (Rule) MarshalJSON

func (s Rule) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Rule) SetAlertingRule

func (s *Rule) SetAlertingRule(v AlertingRule)

SetAlertingRule sets Rule to AlertingRule.

func (*Rule) SetFake

func (s *Rule) SetFake()

SetFake set fake values.

func (*Rule) SetRecordingRule

func (s *Rule) SetRecordingRule(v RecordingRule)

SetRecordingRule sets Rule to RecordingRule.

func (*Rule) UnmarshalJSON

func (s *Rule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (Rule) Validate

func (s Rule) Validate() error

type RuleGroup

type RuleGroup struct {
	Name OptString `json:"name"`
	File OptString `json:"file"`
	// In order to preserve rule ordering, while exposing type (alerting or recording)
	// specific properties, both alerting and recording rules are exposed in the
	// same array.
	Rules          []Rule     `json:"rules"`
	Internal       OptFloat64 `json:"internal"`
	Limit          OptInt     `json:"limit"`
	EvaluationTime OptFloat64 `json:"evaluationTime"`
	LastEvaluation OptString  `json:"lastEvaluation"`
}

Ref: #/components/schemas/RuleGroup

func (*RuleGroup) Decode

func (s *RuleGroup) Decode(d *jx.Decoder) error

Decode decodes RuleGroup from json.

func (*RuleGroup) Encode

func (s *RuleGroup) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*RuleGroup) GetEvaluationTime

func (s *RuleGroup) GetEvaluationTime() OptFloat64

GetEvaluationTime returns the value of EvaluationTime.

func (*RuleGroup) GetFile

func (s *RuleGroup) GetFile() OptString

GetFile returns the value of File.

func (*RuleGroup) GetInternal

func (s *RuleGroup) GetInternal() OptFloat64

GetInternal returns the value of Internal.

func (*RuleGroup) GetLastEvaluation

func (s *RuleGroup) GetLastEvaluation() OptString

GetLastEvaluation returns the value of LastEvaluation.

func (*RuleGroup) GetLimit

func (s *RuleGroup) GetLimit() OptInt

GetLimit returns the value of Limit.

func (*RuleGroup) GetName

func (s *RuleGroup) GetName() OptString

GetName returns the value of Name.

func (*RuleGroup) GetRules

func (s *RuleGroup) GetRules() []Rule

GetRules returns the value of Rules.

func (*RuleGroup) MarshalJSON

func (s *RuleGroup) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RuleGroup) SetEvaluationTime

func (s *RuleGroup) SetEvaluationTime(val OptFloat64)

SetEvaluationTime sets the value of EvaluationTime.

func (*RuleGroup) SetFake

func (s *RuleGroup) SetFake()

SetFake set fake values.

func (*RuleGroup) SetFile

func (s *RuleGroup) SetFile(val OptString)

SetFile sets the value of File.

func (*RuleGroup) SetInternal

func (s *RuleGroup) SetInternal(val OptFloat64)

SetInternal sets the value of Internal.

func (*RuleGroup) SetLastEvaluation

func (s *RuleGroup) SetLastEvaluation(val OptString)

SetLastEvaluation sets the value of LastEvaluation.

func (*RuleGroup) SetLimit

func (s *RuleGroup) SetLimit(val OptInt)

SetLimit sets the value of Limit.

func (*RuleGroup) SetName

func (s *RuleGroup) SetName(val OptString)

SetName sets the value of Name.

func (*RuleGroup) SetRules

func (s *RuleGroup) SetRules(val []Rule)

SetRules sets the value of Rules.

func (*RuleGroup) UnmarshalJSON

func (s *RuleGroup) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RuleGroup) Validate

func (s *RuleGroup) Validate() error

type RuleHealth

type RuleHealth string

Ref: #/components/schemas/RuleHealth

const (
	RuleHealthUnknown RuleHealth = "unknown"
	RuleHealthOk      RuleHealth = "ok"
	RuleHealthErr     RuleHealth = "err"
)

func (RuleHealth) AllValues added in v0.1.0

func (RuleHealth) AllValues() []RuleHealth

AllValues returns all RuleHealth values.

func (*RuleHealth) Decode

func (s *RuleHealth) Decode(d *jx.Decoder) error

Decode decodes RuleHealth from json.

func (RuleHealth) Encode

func (s RuleHealth) Encode(e *jx.Encoder)

Encode encodes RuleHealth as json.

func (RuleHealth) MarshalJSON

func (s RuleHealth) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (RuleHealth) MarshalText

func (s RuleHealth) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*RuleHealth) SetFake

func (s *RuleHealth) SetFake()

SetFake set fake values.

func (*RuleHealth) UnmarshalJSON

func (s *RuleHealth) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RuleHealth) UnmarshalText

func (s *RuleHealth) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (RuleHealth) Validate

func (s RuleHealth) Validate() error

type RuleType

type RuleType string

RuleType is oneOf type of Rule.

const (
	AlertingRuleRule  RuleType = "alerting"
	RecordingRuleRule RuleType = "recording"
)

Possible values for RuleType.

type Rules

type Rules struct {
	Groups []RuleGroup `json:"groups"`
}

Ref: #/components/schemas/Rules

func (*Rules) Decode

func (s *Rules) Decode(d *jx.Decoder) error

Decode decodes Rules from json.

func (*Rules) Encode

func (s *Rules) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Rules) GetGroups

func (s *Rules) GetGroups() []RuleGroup

GetGroups returns the value of Groups.

func (*Rules) MarshalJSON

func (s *Rules) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Rules) SetFake

func (s *Rules) SetFake()

SetFake set fake values.

func (*Rules) SetGroups

func (s *Rules) SetGroups(val []RuleGroup)

SetGroups sets the value of Groups.

func (*Rules) UnmarshalJSON

func (s *Rules) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Rules) Validate

func (s *Rules) Validate() error

type RulesResponse

type RulesResponse struct {
	// Always 'success'.
	Status string `json:"status"`
	// Only if there were warnings while executing the request. There will still be data in the data
	// field.
	Warnings []string `json:"warnings"`
	Data     Rules    `json:"data"`
}

func (*RulesResponse) Decode

func (s *RulesResponse) Decode(d *jx.Decoder) error

Decode decodes RulesResponse from json.

func (*RulesResponse) Encode

func (s *RulesResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*RulesResponse) GetData

func (s *RulesResponse) GetData() Rules

GetData returns the value of Data.

func (*RulesResponse) GetStatus

func (s *RulesResponse) GetStatus() string

GetStatus returns the value of Status.

func (*RulesResponse) GetWarnings

func (s *RulesResponse) GetWarnings() []string

GetWarnings returns the value of Warnings.

func (*RulesResponse) MarshalJSON

func (s *RulesResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RulesResponse) SetData

func (s *RulesResponse) SetData(val Rules)

SetData sets the value of Data.

func (*RulesResponse) SetFake

func (s *RulesResponse) SetFake()

SetFake set fake values.

func (*RulesResponse) SetStatus

func (s *RulesResponse) SetStatus(val string)

SetStatus sets the value of Status.

func (*RulesResponse) SetWarnings

func (s *RulesResponse) SetWarnings(val []string)

SetWarnings sets the value of Warnings.

func (*RulesResponse) UnmarshalJSON

func (s *RulesResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RulesResponse) Validate

func (s *RulesResponse) Validate() error

type Sample added in v0.1.0

type Sample struct {
	T                float64
	HistogramOrValue HistogramOrValue
}

Ref: #/components/schemas/Sample

func (*Sample) Decode added in v0.1.0

func (s *Sample) Decode(d *jx.Decoder) error

Decode decodes Sample from json.

func (*Sample) Encode added in v0.1.0

func (s *Sample) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Sample) GetHistogramOrValue added in v0.1.0

func (s *Sample) GetHistogramOrValue() HistogramOrValue

GetHistogramOrValue returns the value of HistogramOrValue.

func (*Sample) GetT added in v0.1.0

func (s *Sample) GetT() float64

GetT returns the value of T.

func (*Sample) MarshalJSON added in v0.1.0

func (s *Sample) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Sample) SetFake added in v0.1.0

func (s *Sample) SetFake()

SetFake set fake values.

func (*Sample) SetHistogramOrValue added in v0.1.0

func (s *Sample) SetHistogramOrValue(val HistogramOrValue)

SetHistogramOrValue sets the value of HistogramOrValue.

func (*Sample) SetT added in v0.1.0

func (s *Sample) SetT(val float64)

SetT sets the value of T.

func (*Sample) UnmarshalJSON added in v0.1.0

func (s *Sample) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Sample) Validate added in v0.1.0

func (s *Sample) Validate() error

type Scalar

type Scalar struct {
	Result FPoint `json:"result"`
}

Ref: #/components/schemas/Scalar

func (*Scalar) Decode

func (s *Scalar) Decode(d *jx.Decoder) error

Decode decodes Scalar from json.

func (*Scalar) Encode

func (s *Scalar) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Scalar) GetResult

func (s *Scalar) GetResult() FPoint

GetResult returns the value of Result.

func (*Scalar) MarshalJSON

func (s *Scalar) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Scalar) SetFake

func (s *Scalar) SetFake()

SetFake set fake values.

func (*Scalar) SetResult

func (s *Scalar) SetResult(val FPoint)

SetResult sets the value of Result.

func (*Scalar) UnmarshalJSON

func (s *Scalar) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Scalar) Validate

func (s *Scalar) Validate() error

type Series

type Series []LabelSet

func (*Series) Decode

func (s *Series) Decode(d *jx.Decoder) error

Decode decodes Series from json.

func (Series) Encode

func (s Series) Encode(e *jx.Encoder)

Encode encodes Series as json.

func (Series) MarshalJSON

func (s Series) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Series) SetFake

func (s *Series) SetFake()

SetFake set fake values.

func (*Series) UnmarshalJSON

func (s *Series) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (Series) Validate

func (s Series) Validate() error

type SeriesForm added in v0.1.0

type SeriesForm struct {
	Start OptPrometheusTimestamp `json:"start"`
	End   OptPrometheusTimestamp `json:"end"`
	Match []string               `json:"match[]"`
}

Ref: #/components/schemas/SeriesForm

func (*SeriesForm) GetEnd added in v0.1.0

func (s *SeriesForm) GetEnd() OptPrometheusTimestamp

GetEnd returns the value of End.

func (*SeriesForm) GetMatch added in v0.1.0

func (s *SeriesForm) GetMatch() []string

GetMatch returns the value of Match.

func (*SeriesForm) GetStart added in v0.1.0

func (s *SeriesForm) GetStart() OptPrometheusTimestamp

GetStart returns the value of Start.

func (*SeriesForm) SetEnd added in v0.1.0

func (s *SeriesForm) SetEnd(val OptPrometheusTimestamp)

SetEnd sets the value of End.

func (*SeriesForm) SetMatch added in v0.1.0

func (s *SeriesForm) SetMatch(val []string)

SetMatch sets the value of Match.

func (*SeriesForm) SetStart added in v0.1.0

func (s *SeriesForm) SetStart(val OptPrometheusTimestamp)

SetStart sets the value of Start.

func (*SeriesForm) Validate added in v0.1.0

func (s *SeriesForm) Validate() error

type SeriesResponse

type SeriesResponse struct {
	// Always 'success'.
	Status string `json:"status"`
	// Only if there were warnings while executing the request. There will still be data in the data
	// field.
	Warnings []string `json:"warnings"`
	Data     Series   `json:"data"`
}

func (*SeriesResponse) Decode

func (s *SeriesResponse) Decode(d *jx.Decoder) error

Decode decodes SeriesResponse from json.

func (*SeriesResponse) Encode

func (s *SeriesResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SeriesResponse) GetData

func (s *SeriesResponse) GetData() Series

GetData returns the value of Data.

func (*SeriesResponse) GetStatus

func (s *SeriesResponse) GetStatus() string

GetStatus returns the value of Status.

func (*SeriesResponse) GetWarnings

func (s *SeriesResponse) GetWarnings() []string

GetWarnings returns the value of Warnings.

func (*SeriesResponse) MarshalJSON

func (s *SeriesResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SeriesResponse) SetData

func (s *SeriesResponse) SetData(val Series)

SetData sets the value of Data.

func (*SeriesResponse) SetFake

func (s *SeriesResponse) SetFake()

SetFake set fake values.

func (*SeriesResponse) SetStatus

func (s *SeriesResponse) SetStatus(val string)

SetStatus sets the value of Status.

func (*SeriesResponse) SetWarnings

func (s *SeriesResponse) SetWarnings(val []string)

SetWarnings sets the value of Warnings.

func (*SeriesResponse) UnmarshalJSON

func (s *SeriesResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*SeriesResponse) Validate

func (s *SeriesResponse) Validate() error

type Server

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

Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.

func NewServer

func NewServer(h Handler, opts ...ServerOption) (*Server, error)

NewServer creates new Server.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

type ServerOption

type ServerOption interface {
	// contains filtered or unexported methods
}

ServerOption is server config option.

func WithErrorHandler

func WithErrorHandler(h ErrorHandler) ServerOption

WithErrorHandler specifies error handler to use.

func WithMaxMultipartMemory

func WithMaxMultipartMemory(max int64) ServerOption

WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.

func WithMethodNotAllowed

func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption

WithMethodNotAllowed specifies Method Not Allowed handler to use.

func WithMiddleware

func WithMiddleware(m ...Middleware) ServerOption

WithMiddleware specifies middlewares to use.

func WithNotFound

func WithNotFound(notFound http.HandlerFunc) ServerOption

WithNotFound specifies Not Found handler to use.

func WithPathPrefix

func WithPathPrefix(prefix string) ServerOption

WithPathPrefix specifies server path prefix.

type String

type String struct {
	Result StringValue `json:"result"`
}

Ref: #/components/schemas/String

func (*String) Decode

func (s *String) Decode(d *jx.Decoder) error

Decode decodes String from json.

func (*String) Encode

func (s *String) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*String) GetResult

func (s *String) GetResult() StringValue

GetResult returns the value of Result.

func (*String) MarshalJSON

func (s *String) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*String) SetFake

func (s *String) SetFake()

SetFake set fake values.

func (*String) SetResult

func (s *String) SetResult(val StringValue)

SetResult sets the value of Result.

func (*String) UnmarshalJSON

func (s *String) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*String) Validate added in v0.1.0

func (s *String) Validate() error

type StringValue added in v0.1.0

type StringValue struct {
	T float64
	V string
}

Ref: #/components/schemas/StringValue

func (*StringValue) Decode added in v0.1.0

func (s *StringValue) Decode(d *jx.Decoder) error

Decode decodes StringValue from json.

func (*StringValue) Encode added in v0.1.0

func (s *StringValue) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*StringValue) GetT added in v0.1.0

func (s *StringValue) GetT() float64

GetT returns the value of T.

func (*StringValue) GetV added in v0.1.0

func (s *StringValue) GetV() string

GetV returns the value of V.

func (*StringValue) MarshalJSON added in v0.1.0

func (s *StringValue) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*StringValue) SetFake added in v0.1.0

func (s *StringValue) SetFake()

SetFake set fake values.

func (*StringValue) SetT added in v0.1.0

func (s *StringValue) SetT(val float64)

SetT sets the value of T.

func (*StringValue) SetV added in v0.1.0

func (s *StringValue) SetV(val string)

SetV sets the value of V.

func (*StringValue) UnmarshalJSON added in v0.1.0

func (s *StringValue) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*StringValue) Validate added in v0.1.0

func (s *StringValue) Validate() error

type UnimplementedHandler

type UnimplementedHandler struct{}

UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.

func (UnimplementedHandler) GetLabelValues

GetLabelValues implements getLabelValues operation.

GET /api/v1/label/{label}/values

func (UnimplementedHandler) GetLabels

GetLabels implements getLabels operation.

GET /api/v1/labels

func (UnimplementedHandler) GetMetadata

GetMetadata implements getMetadata operation.

GET /api/v1/metadata

func (UnimplementedHandler) GetQuery

func (UnimplementedHandler) GetQuery(ctx context.Context, params GetQueryParams) (r *QueryResponse, _ error)

GetQuery implements getQuery operation.

Query Prometheus.

GET /api/v1/query

func (UnimplementedHandler) GetQueryExemplars

GetQueryExemplars implements getQueryExemplars operation.

Query Prometheus.

GET /api/v1/query_exemplars

func (UnimplementedHandler) GetQueryRange

func (UnimplementedHandler) GetQueryRange(ctx context.Context, params GetQueryRangeParams) (r *QueryResponse, _ error)

GetQueryRange implements getQueryRange operation.

Query Prometheus.

GET /api/v1/query_range

func (UnimplementedHandler) GetRules

func (UnimplementedHandler) GetRules(ctx context.Context, params GetRulesParams) (r *RulesResponse, _ error)

GetRules implements getRules operation.

GET /api/v1/rules

func (UnimplementedHandler) GetSeries

GetSeries implements getSeries operation.

Query Prometheus.

GET /api/v1/series

func (UnimplementedHandler) NewError

func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *FailStatusCode)

NewError creates *FailStatusCode from error returned by handler.

Used for common default response.

func (UnimplementedHandler) PostLabels

func (UnimplementedHandler) PostLabels(ctx context.Context, req *LabelsForm) (r *LabelsResponse, _ error)

PostLabels implements postLabels operation.

POST /api/v1/labels

func (UnimplementedHandler) PostQuery

func (UnimplementedHandler) PostQuery(ctx context.Context, req *QueryForm) (r *QueryResponse, _ error)

PostQuery implements postQuery operation.

Query Prometheus.

POST /api/v1/query

func (UnimplementedHandler) PostQueryExemplars

func (UnimplementedHandler) PostQueryExemplars(ctx context.Context, req *ExemplarsForm) (r *QueryExemplarsResponse, _ error)

PostQueryExemplars implements postQueryExemplars operation.

Query Prometheus.

POST /api/v1/query_exemplars

func (UnimplementedHandler) PostQueryRange

func (UnimplementedHandler) PostQueryRange(ctx context.Context, req *QueryRangeForm) (r *QueryResponse, _ error)

PostQueryRange implements postQueryRange operation.

Query Prometheus.

POST /api/v1/query_range

func (UnimplementedHandler) PostSeries

func (UnimplementedHandler) PostSeries(ctx context.Context, req *SeriesForm) (r *SeriesResponse, _ error)

PostSeries implements postSeries operation.

Query Prometheus.

POST /api/v1/series

type Vector

type Vector struct {
	Result []VectorResultItem `json:"result"`
}

Ref: #/components/schemas/Vector

func (*Vector) Decode

func (s *Vector) Decode(d *jx.Decoder) error

Decode decodes Vector from json.

func (*Vector) Encode

func (s *Vector) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Vector) GetResult

func (s *Vector) GetResult() []VectorResultItem

GetResult returns the value of Result.

func (*Vector) MarshalJSON

func (s *Vector) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Vector) SetFake

func (s *Vector) SetFake()

SetFake set fake values.

func (*Vector) SetResult

func (s *Vector) SetResult(val []VectorResultItem)

SetResult sets the value of Result.

func (*Vector) UnmarshalJSON

func (s *Vector) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Vector) Validate

func (s *Vector) Validate() error

type VectorResultItem

type VectorResultItem struct {
	Metric VectorResultItemMetric `json:"metric"`
	Value  Sample                 `json:"value"`
}

func (*VectorResultItem) Decode

func (s *VectorResultItem) Decode(d *jx.Decoder) error

Decode decodes VectorResultItem from json.

func (*VectorResultItem) Encode

func (s *VectorResultItem) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*VectorResultItem) GetMetric

GetMetric returns the value of Metric.

func (*VectorResultItem) GetValue

func (s *VectorResultItem) GetValue() Sample

GetValue returns the value of Value.

func (*VectorResultItem) MarshalJSON

func (s *VectorResultItem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*VectorResultItem) SetFake

func (s *VectorResultItem) SetFake()

SetFake set fake values.

func (*VectorResultItem) SetMetric

func (s *VectorResultItem) SetMetric(val VectorResultItemMetric)

SetMetric sets the value of Metric.

func (*VectorResultItem) SetValue

func (s *VectorResultItem) SetValue(val Sample)

SetValue sets the value of Value.

func (*VectorResultItem) UnmarshalJSON

func (s *VectorResultItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*VectorResultItem) Validate

func (s *VectorResultItem) Validate() error

type VectorResultItemMetric

type VectorResultItemMetric map[string]string

func (*VectorResultItemMetric) Decode

func (s *VectorResultItemMetric) Decode(d *jx.Decoder) error

Decode decodes VectorResultItemMetric from json.

func (VectorResultItemMetric) Encode

func (s VectorResultItemMetric) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (VectorResultItemMetric) MarshalJSON

func (s VectorResultItemMetric) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*VectorResultItemMetric) SetFake

func (s *VectorResultItemMetric) SetFake()

SetFake set fake values.

func (*VectorResultItemMetric) UnmarshalJSON

func (s *VectorResultItemMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

Jump to

Keyboard shortcuts

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