promapi

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 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) 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 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) (*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) (*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) (*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    OptLabelSet `json:"labels"`
	Value     OptFloat64  `json:"value"`
	Timestamp OptInt64    `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() OptLabelSet

GetLabels returns the value of Labels.

func (*Exemplar) GetTimestamp

func (s *Exemplar) GetTimestamp() OptInt64

GetTimestamp returns the value of Timestamp.

func (*Exemplar) GetValue

func (s *Exemplar) GetValue() OptFloat64

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 OptLabelSet)

SetLabels sets the value of Labels.

func (*Exemplar) SetTimestamp

func (s *Exemplar) SetTimestamp(val OptInt64)

SetTimestamp sets the value of Timestamp.

func (*Exemplar) SetValue

func (s *Exemplar) SetValue(val OptFloat64)

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 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 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) 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
}

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
	// Evaluation timeout.
	Timeout OptPrometheusDuration
}

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) 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 PrometheusTimestamp
	// End timestamp.
	End PrometheusTimestamp
	// Repeated series selector argument that selects the series from which to read the label names.
	Match []string
}

GetSeriesParams is parameters of getSeries operation.

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) (*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) (*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) (*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 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 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 []Value                `json:"values"`
}

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) GetMetric

GetMetric returns the value of Metric.

func (*MatrixResultItem) GetValues

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

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) SetMetric

func (s *MatrixResultItem) SetMetric(val MatrixResultItemMetric)

SetMetric sets the value of Metric.

func (*MatrixResultItem) SetValues

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

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) 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 OptInt64

type OptInt64 struct {
	Value int64
	Set   bool
}

OptInt64 is optional int64.

func NewOptInt64

func NewOptInt64(v int64) OptInt64

NewOptInt64 returns new OptInt64 with value set to v.

func (*OptInt64) Decode

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

Decode decodes int64 from json.

func (OptInt64) Encode

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

Encode encodes int64 as json.

func (OptInt64) Get

func (o OptInt64) Get() (v int64, ok bool)

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

func (OptInt64) IsSet

func (o OptInt64) IsSet() bool

IsSet returns true if OptInt64 was set.

func (OptInt64) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptInt64) Or

func (o OptInt64) Or(d int64) int64

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

func (*OptInt64) Reset

func (o *OptInt64) Reset()

Reset unsets value.

func (*OptInt64) SetFake

func (s *OptInt64) SetFake()

SetFake set fake values.

func (*OptInt64) SetTo

func (o *OptInt64) SetTo(v int64)

SetTo sets value to v.

func (*OptInt64) UnmarshalJSON

func (s *OptInt64) 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 OptPrometheusDuration

type OptPrometheusDuration struct {
	Value PrometheusDuration
	Set   bool
}

OptPrometheusDuration is optional PrometheusDuration.

func NewOptPrometheusDuration

func NewOptPrometheusDuration(v PrometheusDuration) OptPrometheusDuration

NewOptPrometheusDuration returns new OptPrometheusDuration with value set to v.

func (OptPrometheusDuration) Get

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

func (OptPrometheusDuration) IsSet

func (o OptPrometheusDuration) IsSet() bool

IsSet returns true if OptPrometheusDuration was set.

func (OptPrometheusDuration) Or

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

func (*OptPrometheusDuration) Reset

func (o *OptPrometheusDuration) Reset()

Reset unsets value.

func (*OptPrometheusDuration) SetTo

SetTo sets value to v.

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 PrometheusDuration

type PrometheusDuration string

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

Ref: #/components/schemas/QueryForm

func (*QueryForm) GetQuery

func (s *QueryForm) GetQuery() string

GetQuery returns the value of Query.

func (*QueryForm) GetTime

func (s *QueryForm) GetTime() OptPrometheusTimestamp

GetTime returns the value of Time.

func (*QueryForm) SetQuery

func (s *QueryForm) SetQuery(val string)

SetQuery sets the value of Query.

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"`
	Time  OptPrometheusTimestamp `json:"time"`
	Start PrometheusTimestamp    `json:"start"`
	End   PrometheusTimestamp    `json:"end"`
	// Query resolution step width in duration format or float number of seconds.
	Step    string                 `json:"step"`
	Timeout OptPrometheusTimestamp `json:"timeout"`
}

Ref: #/components/schemas/QueryRangeForm

func (*QueryRangeForm) GetEnd

func (s *QueryRangeForm) GetEnd() PrometheusTimestamp

GetEnd returns the value of End.

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) GetStep

func (s *QueryRangeForm) GetStep() string

GetStep returns the value of Step.

func (*QueryRangeForm) GetTime

GetTime returns the value of Time.

func (*QueryRangeForm) GetTimeout

func (s *QueryRangeForm) GetTimeout() OptPrometheusTimestamp

GetTimeout returns the value of Timeout.

func (*QueryRangeForm) SetEnd

func (s *QueryRangeForm) SetEnd(val PrometheusTimestamp)

SetEnd sets the value of End.

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) SetStep

func (s *QueryRangeForm) SetStep(val string)

SetStep sets the value of Step.

func (*QueryRangeForm) SetTime

func (s *QueryRangeForm) SetTime(val OptPrometheusTimestamp)

SetTime sets the value of Time.

func (*QueryRangeForm) SetTimeout

func (s *QueryRangeForm) SetTimeout(val OptPrometheusTimestamp)

SetTimeout sets the value of Timeout.

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.

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) 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 = "AlertingRule"
	RecordingRuleRule RuleType = "RecordingRule"
)

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 Scalar

type Scalar struct {
	Result Value `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() Value

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 Value)

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 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 string `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() string

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 string)

SetResult sets the value of Result.

func (*String) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

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) (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) (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) (r *SeriesResponse, _ error)

PostSeries implements postSeries operation.

Query Prometheus.

POST /api/v1/series

type Value

type Value struct {
	T float64
	V float64
}

Ref: #/components/schemas/Value

func (*Value) Decode

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

Decode decodes Value from json.

func (*Value) Encode

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

Encode implements json.Marshaler.

func (*Value) GetT

func (s *Value) GetT() float64

GetT returns the value of T.

func (*Value) GetV

func (s *Value) GetV() float64

GetV returns the value of V.

func (*Value) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Value) SetFake

func (s *Value) SetFake()

SetFake set fake values.

func (*Value) SetT

func (s *Value) SetT(val float64)

SetT sets the value of T.

func (*Value) SetV

func (s *Value) SetV(val float64)

SetV sets the value of V.

func (*Value) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Value) Validate

func (s *Value) Validate() error

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  Value                  `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() Value

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 Value)

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