lokiapi

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Code generated by ogen, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithServerURL

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

WithServerURL sets context key to override server URL.

Types

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) DetectedFieldValues added in v0.40.0

func (c *Client) DetectedFieldValues(ctx context.Context, params DetectedFieldValuesParams) (*DetectedFieldValues, error)

DetectedFieldValues invokes detectedFieldValues operation.

Get detected field values.

GET /loki/api/v1/detected_field/{field}/values

func (*Client) DetectedFields added in v0.40.0

func (c *Client) DetectedFields(ctx context.Context, params DetectedFieldsParams) (*DetectedFields, error)

DetectedFields invokes detectedFields operation.

Get detected fields.

GET /loki/api/v1/detected_fields

func (*Client) DetectedLabels added in v0.40.0

func (c *Client) DetectedLabels(ctx context.Context, params DetectedLabelsParams) (*DetectedLabels, error)

DetectedLabels invokes detectedLabels operation.

Get detected labels. Used by Grafana to test Logs Drilldown availability.

GET /loki/api/v1/detected_labels

func (*Client) DrilldownLimits added in v0.40.0

func (c *Client) DrilldownLimits(ctx context.Context) (*DrilldownLimits, error)

DrilldownLimits invokes drilldownLimits operation.

Get drilldown limits. Used by Grafana to get limits from Loki.

GET /loki/api/v1/drilldown-limits

func (*Client) IndexStats added in v0.1.0

func (c *Client) IndexStats(ctx context.Context, params IndexStatsParams) (*IndexStats, error)

IndexStats invokes indexStats operation.

Get index stats.

GET /loki/api/v1/index/stats

func (*Client) LabelValues

func (c *Client) LabelValues(ctx context.Context, params LabelValuesParams) (*Values, error)

LabelValues invokes labelValues operation.

Get values of label.

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

func (*Client) Labels

func (c *Client) Labels(ctx context.Context, params LabelsParams) (*Labels, error)

Labels invokes labels operation.

Get labels. Used by Grafana to test connection to Loki.

GET /loki/api/v1/labels

func (*Client) Patterns added in v0.40.0

func (c *Client) Patterns(ctx context.Context, params PatternsParams) (*Patterns, error)

Patterns invokes patterns operation.

Endpoint can be used to query loki for patterns detected in the logs. This helps understand the structure of the logs Loki has ingested.

GET /loki/api/v1/patterns

func (*Client) Push

func (c *Client) Push(ctx context.Context, request PushReq) error

Push invokes push operation.

Push data.

POST /loki/api/v1/push

func (*Client) Query

func (c *Client) Query(ctx context.Context, params QueryParams) (*QueryResponse, error)

Query invokes query operation.

Query.

GET /loki/api/v1/query

func (*Client) QueryRange

func (c *Client) QueryRange(ctx context.Context, params QueryRangeParams) (*QueryResponse, error)

QueryRange invokes queryRange operation.

Query range.

GET /loki/api/v1/query_range

func (*Client) QueryVolume added in v0.40.0

func (c *Client) QueryVolume(ctx context.Context, params QueryVolumeParams) (*QueryResponse, error)

QueryVolume invokes queryVolume operation.

Query the index for volume information about label and label-value combinations.

GET /loki/api/v1/index/volume

func (*Client) QueryVolumeRange added in v0.40.0

func (c *Client) QueryVolumeRange(ctx context.Context, params QueryVolumeRangeParams) (*QueryResponse, error)

QueryVolumeRange invokes queryVolumeRange operation.

Query the index for volume information about label and label-value combinations.

GET /loki/api/v1/index/volume_range

func (*Client) Series

func (c *Client) Series(ctx context.Context, params SeriesParams) (*Maps, error)

Series invokes series operation.

Get series.

GET /loki/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 DetectedField added in v0.40.0

type DetectedField struct {
	Label       OptString         `json:"label"`
	Type        OptString         `json:"type"`
	Cardinality OptInt            `json:"cardinality"`
	Parsers     OptNilStringArray `json:"parsers"`
	JsonPath    OptNilStringArray `json:"jsonPath"`
}

Ref: #/components/schemas/DetectedField

func (*DetectedField) Decode added in v0.40.0

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

Decode decodes DetectedField from json.

func (*DetectedField) Encode added in v0.40.0

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

Encode implements json.Marshaler.

func (*DetectedField) GetCardinality added in v0.40.0

func (s *DetectedField) GetCardinality() OptInt

GetCardinality returns the value of Cardinality.

func (*DetectedField) GetJsonPath added in v0.40.0

func (s *DetectedField) GetJsonPath() OptNilStringArray

GetJsonPath returns the value of JsonPath.

func (*DetectedField) GetLabel added in v0.40.0

func (s *DetectedField) GetLabel() OptString

GetLabel returns the value of Label.

func (*DetectedField) GetParsers added in v0.40.0

func (s *DetectedField) GetParsers() OptNilStringArray

GetParsers returns the value of Parsers.

func (*DetectedField) GetType added in v0.40.0

func (s *DetectedField) GetType() OptString

GetType returns the value of Type.

func (*DetectedField) MarshalJSON added in v0.40.0

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

MarshalJSON implements stdjson.Marshaler.

func (*DetectedField) SetCardinality added in v0.40.0

func (s *DetectedField) SetCardinality(val OptInt)

SetCardinality sets the value of Cardinality.

func (*DetectedField) SetJsonPath added in v0.40.0

func (s *DetectedField) SetJsonPath(val OptNilStringArray)

SetJsonPath sets the value of JsonPath.

func (*DetectedField) SetLabel added in v0.40.0

func (s *DetectedField) SetLabel(val OptString)

SetLabel sets the value of Label.

func (*DetectedField) SetParsers added in v0.40.0

func (s *DetectedField) SetParsers(val OptNilStringArray)

SetParsers sets the value of Parsers.

func (*DetectedField) SetType added in v0.40.0

func (s *DetectedField) SetType(val OptString)

SetType sets the value of Type.

func (*DetectedField) UnmarshalJSON added in v0.40.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*DetectedField) Validate added in v0.40.0

func (s *DetectedField) Validate() error

type DetectedFieldValues added in v0.40.0

type DetectedFieldValues struct {
	Values OptNilStringArray `json:"values"`
	Limit  OptUint64         `json:"limit"`
}

Ref: #/components/schemas/DetectedFieldValues

func (*DetectedFieldValues) Decode added in v0.40.0

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

Decode decodes DetectedFieldValues from json.

func (*DetectedFieldValues) Encode added in v0.40.0

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

Encode implements json.Marshaler.

func (*DetectedFieldValues) GetLimit added in v0.40.0

func (s *DetectedFieldValues) GetLimit() OptUint64

GetLimit returns the value of Limit.

func (*DetectedFieldValues) GetValues added in v0.40.0

func (s *DetectedFieldValues) GetValues() OptNilStringArray

GetValues returns the value of Values.

func (*DetectedFieldValues) MarshalJSON added in v0.40.0

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

MarshalJSON implements stdjson.Marshaler.

func (*DetectedFieldValues) SetLimit added in v0.40.0

func (s *DetectedFieldValues) SetLimit(val OptUint64)

SetLimit sets the value of Limit.

func (*DetectedFieldValues) SetValues added in v0.40.0

func (s *DetectedFieldValues) SetValues(val OptNilStringArray)

SetValues sets the value of Values.

func (*DetectedFieldValues) UnmarshalJSON added in v0.40.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*DetectedFieldValues) Validate added in v0.40.0

func (s *DetectedFieldValues) Validate() error

type DetectedFieldValuesParams added in v0.40.0

type DetectedFieldValuesParams struct {
	// Field to query.
	Field string
	// The LogQL matchers to check (that is, `{job="foo", env=~".+"}`).
	Query OptString `json:",omitempty,omitzero"`
	// The start time for the query as a nanosecond Unix epoch.
	// Defaults to 6 hours ago.
	Start OptLokiTime `json:",omitempty,omitzero"`
	// The end time for the query as a nanosecond Unix epoch.
	// Defaults to now.
	End OptLokiTime `json:",omitempty,omitzero"`
	// A `duration` used to calculate `start` relative to `end`.
	// If `end` is in the future, `start` is calculated as this duration before now.
	// Any value specified for start supersedes this parameter.
	Since OptPrometheusDuration `json:",omitempty,omitzero"`
}

DetectedFieldValuesParams is parameters of detectedFieldValues operation.

type DetectedFields added in v0.40.0

type DetectedFields struct {
	Fields []DetectedField `json:"fields"`
	Limit  OptUint64       `json:"limit"`
}

Ref: #/components/schemas/DetectedFields

func (*DetectedFields) Decode added in v0.40.0

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

Decode decodes DetectedFields from json.

func (*DetectedFields) Encode added in v0.40.0

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

Encode implements json.Marshaler.

func (*DetectedFields) GetFields added in v0.40.0

func (s *DetectedFields) GetFields() []DetectedField

GetFields returns the value of Fields.

func (*DetectedFields) GetLimit added in v0.40.0

func (s *DetectedFields) GetLimit() OptUint64

GetLimit returns the value of Limit.

func (*DetectedFields) MarshalJSON added in v0.40.0

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

MarshalJSON implements stdjson.Marshaler.

func (*DetectedFields) SetFields added in v0.40.0

func (s *DetectedFields) SetFields(val []DetectedField)

SetFields sets the value of Fields.

func (*DetectedFields) SetLimit added in v0.40.0

func (s *DetectedFields) SetLimit(val OptUint64)

SetLimit sets the value of Limit.

func (*DetectedFields) UnmarshalJSON added in v0.40.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*DetectedFields) Validate added in v0.40.0

func (s *DetectedFields) Validate() error

type DetectedFieldsParams added in v0.40.0

type DetectedFieldsParams struct {
	// The LogQL matchers to check (that is, `{job="foo", env=~".+"}`).
	Query OptString `json:",omitempty,omitzero"`
	// The start time for the query as a nanosecond Unix epoch.
	// Defaults to 6 hours ago.
	Start OptLokiTime `json:",omitempty,omitzero"`
	// The end time for the query as a nanosecond Unix epoch.
	// Defaults to now.
	End OptLokiTime `json:",omitempty,omitzero"`
	// A `duration` used to calculate `start` relative to `end`.
	// If `end` is in the future, `start` is calculated as this duration before now.
	// Any value specified for start supersedes this parameter.
	Since OptPrometheusDuration `json:",omitempty,omitzero"`
}

DetectedFieldsParams is parameters of detectedFields operation.

type DetectedLabel added in v0.40.0

type DetectedLabel struct {
	Label       string `json:"label"`
	Cardinality int    `json:"cardinality"`
}

Ref: #/components/schemas/DetectedLabel

func (*DetectedLabel) Decode added in v0.40.0

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

Decode decodes DetectedLabel from json.

func (*DetectedLabel) Encode added in v0.40.0

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

Encode implements json.Marshaler.

func (*DetectedLabel) GetCardinality added in v0.40.0

func (s *DetectedLabel) GetCardinality() int

GetCardinality returns the value of Cardinality.

func (*DetectedLabel) GetLabel added in v0.40.0

func (s *DetectedLabel) GetLabel() string

GetLabel returns the value of Label.

func (*DetectedLabel) MarshalJSON added in v0.40.0

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

MarshalJSON implements stdjson.Marshaler.

func (*DetectedLabel) SetCardinality added in v0.40.0

func (s *DetectedLabel) SetCardinality(val int)

SetCardinality sets the value of Cardinality.

func (*DetectedLabel) SetLabel added in v0.40.0

func (s *DetectedLabel) SetLabel(val string)

SetLabel sets the value of Label.

func (*DetectedLabel) UnmarshalJSON added in v0.40.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type DetectedLabels added in v0.40.0

type DetectedLabels struct {
	DetectedLabels []DetectedLabel `json:"detectedLabels"`
	Limit          OptUint64       `json:"limit"`
}

Ref: #/components/schemas/DetectedLabels

func (*DetectedLabels) Decode added in v0.40.0

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

Decode decodes DetectedLabels from json.

func (*DetectedLabels) Encode added in v0.40.0

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

Encode implements json.Marshaler.

func (*DetectedLabels) GetDetectedLabels added in v0.40.0

func (s *DetectedLabels) GetDetectedLabels() []DetectedLabel

GetDetectedLabels returns the value of DetectedLabels.

func (*DetectedLabels) GetLimit added in v0.40.0

func (s *DetectedLabels) GetLimit() OptUint64

GetLimit returns the value of Limit.

func (*DetectedLabels) MarshalJSON added in v0.40.0

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

MarshalJSON implements stdjson.Marshaler.

func (*DetectedLabels) SetDetectedLabels added in v0.40.0

func (s *DetectedLabels) SetDetectedLabels(val []DetectedLabel)

SetDetectedLabels sets the value of DetectedLabels.

func (*DetectedLabels) SetLimit added in v0.40.0

func (s *DetectedLabels) SetLimit(val OptUint64)

SetLimit sets the value of Limit.

func (*DetectedLabels) UnmarshalJSON added in v0.40.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type DetectedLabelsParams added in v0.40.0

type DetectedLabelsParams struct {
	// The LogQL matchers to check (that is, `{job="foo", env=~".+"}`).
	Query OptString `json:",omitempty,omitzero"`
	// The start time for the query as a nanosecond Unix epoch.
	// Defaults to 6 hours ago.
	Start OptLokiTime `json:",omitempty,omitzero"`
	// The end time for the query as a nanosecond Unix epoch.
	// Defaults to now.
	End OptLokiTime `json:",omitempty,omitzero"`
	// A `duration` used to calculate `start` relative to `end`.
	// If `end` is in the future, `start` is calculated as this duration before now.
	// Any value specified for start supersedes this parameter.
	Since OptPrometheusDuration `json:",omitempty,omitzero"`
}

DetectedLabelsParams is parameters of detectedLabels operation.

type Direction

type Direction string

Ref: #/components/schemas/Direction

const (
	DirectionBackward Direction = "backward"
	DirectionForward  Direction = "forward"
)

func (Direction) AllValues added in v0.1.0

func (Direction) AllValues() []Direction

AllValues returns all Direction values.

func (Direction) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*Direction) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (Direction) Validate

func (s Direction) Validate() error

type DrilldownLimits added in v0.40.0

type DrilldownLimits struct {
	Limits                 DrilldownLimitsLimits `json:"limits"`
	PatternIngesterEnabled OptBool               `json:"pattern_ingester_enabled"`
	Version                string                `json:"version"`
}

Ref: #/components/schemas/DrilldownLimits

func (*DrilldownLimits) Decode added in v0.40.0

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

Decode decodes DrilldownLimits from json.

func (*DrilldownLimits) Encode added in v0.40.0

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

Encode implements json.Marshaler.

func (*DrilldownLimits) GetLimits added in v0.40.0

func (s *DrilldownLimits) GetLimits() DrilldownLimitsLimits

GetLimits returns the value of Limits.

func (*DrilldownLimits) GetPatternIngesterEnabled added in v0.40.0

func (s *DrilldownLimits) GetPatternIngesterEnabled() OptBool

GetPatternIngesterEnabled returns the value of PatternIngesterEnabled.

func (*DrilldownLimits) GetVersion added in v0.40.0

func (s *DrilldownLimits) GetVersion() string

GetVersion returns the value of Version.

func (*DrilldownLimits) MarshalJSON added in v0.40.0

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

MarshalJSON implements stdjson.Marshaler.

func (*DrilldownLimits) SetLimits added in v0.40.0

func (s *DrilldownLimits) SetLimits(val DrilldownLimitsLimits)

SetLimits sets the value of Limits.

func (*DrilldownLimits) SetPatternIngesterEnabled added in v0.40.0

func (s *DrilldownLimits) SetPatternIngesterEnabled(val OptBool)

SetPatternIngesterEnabled sets the value of PatternIngesterEnabled.

func (*DrilldownLimits) SetVersion added in v0.40.0

func (s *DrilldownLimits) SetVersion(val string)

SetVersion sets the value of Version.

func (*DrilldownLimits) UnmarshalJSON added in v0.40.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type DrilldownLimitsLimits added in v0.40.0

type DrilldownLimitsLimits struct {
	VolumeEnabled OptBool `json:"volume_enabled"`
}

func (*DrilldownLimitsLimits) Decode added in v0.40.0

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

Decode decodes DrilldownLimitsLimits from json.

func (*DrilldownLimitsLimits) Encode added in v0.40.0

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

Encode implements json.Marshaler.

func (*DrilldownLimitsLimits) GetVolumeEnabled added in v0.40.0

func (s *DrilldownLimitsLimits) GetVolumeEnabled() OptBool

GetVolumeEnabled returns the value of VolumeEnabled.

func (*DrilldownLimitsLimits) MarshalJSON added in v0.40.0

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

MarshalJSON implements stdjson.Marshaler.

func (*DrilldownLimitsLimits) SetVolumeEnabled added in v0.40.0

func (s *DrilldownLimitsLimits) SetVolumeEnabled(val OptBool)

SetVolumeEnabled sets the value of VolumeEnabled.

func (*DrilldownLimitsLimits) UnmarshalJSON added in v0.40.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Error

type Error string

func (*Error) Decode

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

Decode decodes Error from json.

func (Error) Encode

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

Encode encodes Error as json.

func (Error) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Error) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type ErrorStatusCode

type ErrorStatusCode struct {
	StatusCode int
	Response   Error
}

ErrorStatusCode wraps Error with StatusCode.

func (*ErrorStatusCode) Error

func (s *ErrorStatusCode) Error() string

func (*ErrorStatusCode) GetResponse

func (s *ErrorStatusCode) GetResponse() Error

GetResponse returns the value of Response.

func (*ErrorStatusCode) GetStatusCode

func (s *ErrorStatusCode) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*ErrorStatusCode) SetResponse

func (s *ErrorStatusCode) SetResponse(val Error)

SetResponse sets the value of Response.

func (*ErrorStatusCode) SetStatusCode

func (s *ErrorStatusCode) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

type FPoint added in v0.0.8

type FPoint struct {
	T float64
	V string
}

Ref: #/components/schemas/FPoint

func (*FPoint) Decode added in v0.0.8

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

Decode decodes FPoint from json.

func (*FPoint) Encode added in v0.0.8

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

Encode implements json.Marshaler.

func (*FPoint) GetT added in v0.0.8

func (s *FPoint) GetT() float64

GetT returns the value of T.

func (*FPoint) GetV added in v0.0.8

func (s *FPoint) GetV() string

GetV returns the value of V.

func (*FPoint) MarshalJSON added in v0.0.8

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

MarshalJSON implements stdjson.Marshaler.

func (*FPoint) SetT added in v0.0.8

func (s *FPoint) SetT(val float64)

SetT sets the value of T.

func (*FPoint) SetV added in v0.0.8

func (s *FPoint) SetV(val string)

SetV sets the value of V.

func (*FPoint) UnmarshalJSON added in v0.0.8

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*FPoint) Validate added in v0.0.8

func (s *FPoint) Validate() error

type Handler

type Handler interface {
	// DetectedFieldValues implements detectedFieldValues operation.
	//
	// Get detected field values.
	//
	// GET /loki/api/v1/detected_field/{field}/values
	DetectedFieldValues(ctx context.Context, params DetectedFieldValuesParams) (*DetectedFieldValues, error)
	// DetectedFields implements detectedFields operation.
	//
	// Get detected fields.
	//
	// GET /loki/api/v1/detected_fields
	DetectedFields(ctx context.Context, params DetectedFieldsParams) (*DetectedFields, error)
	// DetectedLabels implements detectedLabels operation.
	//
	// Get detected labels.
	// Used by Grafana to test Logs Drilldown availability.
	//
	// GET /loki/api/v1/detected_labels
	DetectedLabels(ctx context.Context, params DetectedLabelsParams) (*DetectedLabels, error)
	// DrilldownLimits implements drilldownLimits operation.
	//
	// Get drilldown limits.
	// Used by Grafana to get limits from Loki.
	//
	// GET /loki/api/v1/drilldown-limits
	DrilldownLimits(ctx context.Context) (*DrilldownLimits, error)
	// IndexStats implements indexStats operation.
	//
	// Get index stats.
	//
	// GET /loki/api/v1/index/stats
	IndexStats(ctx context.Context, params IndexStatsParams) (*IndexStats, error)
	// LabelValues implements labelValues operation.
	//
	// Get values of label.
	//
	// GET /loki/api/v1/label/{name}/values
	LabelValues(ctx context.Context, params LabelValuesParams) (*Values, error)
	// Labels implements labels operation.
	//
	// Get labels.
	// Used by Grafana to test connection to Loki.
	//
	// GET /loki/api/v1/labels
	Labels(ctx context.Context, params LabelsParams) (*Labels, error)
	// Patterns implements patterns operation.
	//
	// Endpoint can be used to query loki for patterns detected in the logs.
	// This helps understand the structure of the logs Loki has ingested.
	//
	// GET /loki/api/v1/patterns
	Patterns(ctx context.Context, params PatternsParams) (*Patterns, error)
	// Push implements push operation.
	//
	// Push data.
	//
	// POST /loki/api/v1/push
	Push(ctx context.Context, req PushReq) error
	// Query implements query operation.
	//
	// Query.
	//
	// GET /loki/api/v1/query
	Query(ctx context.Context, params QueryParams) (*QueryResponse, error)
	// QueryRange implements queryRange operation.
	//
	// Query range.
	//
	// GET /loki/api/v1/query_range
	QueryRange(ctx context.Context, params QueryRangeParams) (*QueryResponse, error)
	// QueryVolume implements queryVolume operation.
	//
	// Query the index for volume information about label and label-value combinations.
	//
	// GET /loki/api/v1/index/volume
	QueryVolume(ctx context.Context, params QueryVolumeParams) (*QueryResponse, error)
	// QueryVolumeRange implements queryVolumeRange operation.
	//
	// Query the index for volume information about label and label-value combinations.
	//
	// GET /loki/api/v1/index/volume_range
	QueryVolumeRange(ctx context.Context, params QueryVolumeRangeParams) (*QueryResponse, error)
	// Series implements series operation.
	//
	// Get series.
	//
	// GET /loki/api/v1/series
	Series(ctx context.Context, params SeriesParams) (*Maps, error)
	// NewError creates *ErrorStatusCode from error returned by handler.
	//
	// Used for common default response.
	NewError(ctx context.Context, err error) *ErrorStatusCode
}

Handler handles operations described by OpenAPI v3 specification.

type IndexStats added in v0.1.0

type IndexStats struct {
	Streams int `json:"streams"`
	Chunks  int `json:"chunks"`
	Entries int `json:"entries"`
	Bytes   int `json:"bytes"`
}

Ref: #/components/schemas/IndexStats

func (*IndexStats) Decode added in v0.1.0

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

Decode decodes IndexStats from json.

func (*IndexStats) Encode added in v0.1.0

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

Encode implements json.Marshaler.

func (*IndexStats) GetBytes added in v0.1.0

func (s *IndexStats) GetBytes() int

GetBytes returns the value of Bytes.

func (*IndexStats) GetChunks added in v0.1.0

func (s *IndexStats) GetChunks() int

GetChunks returns the value of Chunks.

func (*IndexStats) GetEntries added in v0.1.0

func (s *IndexStats) GetEntries() int

GetEntries returns the value of Entries.

func (*IndexStats) GetStreams added in v0.1.0

func (s *IndexStats) GetStreams() int

GetStreams returns the value of Streams.

func (*IndexStats) MarshalJSON added in v0.1.0

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

MarshalJSON implements stdjson.Marshaler.

func (*IndexStats) SetBytes added in v0.1.0

func (s *IndexStats) SetBytes(val int)

SetBytes sets the value of Bytes.

func (*IndexStats) SetChunks added in v0.1.0

func (s *IndexStats) SetChunks(val int)

SetChunks sets the value of Chunks.

func (*IndexStats) SetEntries added in v0.1.0

func (s *IndexStats) SetEntries(val int)

SetEntries sets the value of Entries.

func (*IndexStats) SetStreams added in v0.1.0

func (s *IndexStats) SetStreams(val int)

SetStreams sets the value of Streams.

func (*IndexStats) UnmarshalJSON added in v0.1.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type IndexStatsParams added in v0.1.0

type IndexStatsParams struct {
	Start OptLokiTime `json:",omitempty,omitzero"`
	End   OptLokiTime `json:",omitempty,omitzero"`
	// The LogQL matchers to check.
	Query string
}

IndexStatsParams is parameters of indexStats operation.

type Invoker added in v0.1.0

type Invoker interface {
	// DetectedFieldValues invokes detectedFieldValues operation.
	//
	// Get detected field values.
	//
	// GET /loki/api/v1/detected_field/{field}/values
	DetectedFieldValues(ctx context.Context, params DetectedFieldValuesParams) (*DetectedFieldValues, error)
	// DetectedFields invokes detectedFields operation.
	//
	// Get detected fields.
	//
	// GET /loki/api/v1/detected_fields
	DetectedFields(ctx context.Context, params DetectedFieldsParams) (*DetectedFields, error)
	// DetectedLabels invokes detectedLabels operation.
	//
	// Get detected labels.
	// Used by Grafana to test Logs Drilldown availability.
	//
	// GET /loki/api/v1/detected_labels
	DetectedLabels(ctx context.Context, params DetectedLabelsParams) (*DetectedLabels, error)
	// DrilldownLimits invokes drilldownLimits operation.
	//
	// Get drilldown limits.
	// Used by Grafana to get limits from Loki.
	//
	// GET /loki/api/v1/drilldown-limits
	DrilldownLimits(ctx context.Context) (*DrilldownLimits, error)
	// IndexStats invokes indexStats operation.
	//
	// Get index stats.
	//
	// GET /loki/api/v1/index/stats
	IndexStats(ctx context.Context, params IndexStatsParams) (*IndexStats, error)
	// LabelValues invokes labelValues operation.
	//
	// Get values of label.
	//
	// GET /loki/api/v1/label/{name}/values
	LabelValues(ctx context.Context, params LabelValuesParams) (*Values, error)
	// Labels invokes labels operation.
	//
	// Get labels.
	// Used by Grafana to test connection to Loki.
	//
	// GET /loki/api/v1/labels
	Labels(ctx context.Context, params LabelsParams) (*Labels, error)
	// Patterns invokes patterns operation.
	//
	// Endpoint can be used to query loki for patterns detected in the logs.
	// This helps understand the structure of the logs Loki has ingested.
	//
	// GET /loki/api/v1/patterns
	Patterns(ctx context.Context, params PatternsParams) (*Patterns, error)
	// Push invokes push operation.
	//
	// Push data.
	//
	// POST /loki/api/v1/push
	Push(ctx context.Context, request PushReq) error
	// Query invokes query operation.
	//
	// Query.
	//
	// GET /loki/api/v1/query
	Query(ctx context.Context, params QueryParams) (*QueryResponse, error)
	// QueryRange invokes queryRange operation.
	//
	// Query range.
	//
	// GET /loki/api/v1/query_range
	QueryRange(ctx context.Context, params QueryRangeParams) (*QueryResponse, error)
	// QueryVolume invokes queryVolume operation.
	//
	// Query the index for volume information about label and label-value combinations.
	//
	// GET /loki/api/v1/index/volume
	QueryVolume(ctx context.Context, params QueryVolumeParams) (*QueryResponse, error)
	// QueryVolumeRange invokes queryVolumeRange operation.
	//
	// Query the index for volume information about label and label-value combinations.
	//
	// GET /loki/api/v1/index/volume_range
	QueryVolumeRange(ctx context.Context, params QueryVolumeRangeParams) (*QueryResponse, error)
	// Series invokes series operation.
	//
	// Get series.
	//
	// GET /loki/api/v1/series
	Series(ctx context.Context, params SeriesParams) (*Maps, 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) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type LabelValuesParams

type LabelValuesParams struct {
	// The start time for the query as a nanosecond Unix epoch.
	// Defaults to 6 hours ago.
	Start OptLokiTime `json:",omitempty,omitzero"`
	// The end time for the query as a nanosecond Unix epoch.
	// Defaults to now.
	End OptLokiTime `json:",omitempty,omitzero"`
	// A `duration` used to calculate `start` relative to `end`.
	// If `end` is in the future, `start` is calculated as this duration before now.
	// Any value specified for start supersedes this parameter.
	Since OptPrometheusDuration `json:",omitempty,omitzero"`
	// A set of log stream selector that selects the streams to match and return label values for
	// `{name}`.
	Query OptString `json:",omitempty,omitzero"`
	// Label name.
	Name string
}

LabelValuesParams is parameters of labelValues operation.

type Labeler added in v0.10.0

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

Labeler is used to allow adding custom attributes to the server request metrics.

func LabelerFromContext added in v0.10.0

func LabelerFromContext(ctx context.Context) (*Labeler, bool)

LabelerFromContext retrieves the Labeler from the provided context, if present.

If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.

func (*Labeler) Add added in v0.10.0

func (l *Labeler) Add(attrs ...attribute.KeyValue)

Add attributes to the Labeler.

func (*Labeler) AttributeSet added in v0.10.0

func (l *Labeler) AttributeSet() attribute.Set

AttributeSet returns the attributes added to the Labeler as an attribute.Set.

type Labels

type Labels struct {
	Data   []string `json:"data"`
	Status string   `json:"status"`
}

Array of label names. Ref: #/components/schemas/Labels

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 implements json.Marshaler.

func (*Labels) GetData

func (s *Labels) GetData() []string

GetData returns the value of Data.

func (*Labels) GetStatus

func (s *Labels) GetStatus() string

GetStatus returns the value of Status.

func (*Labels) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Labels) SetData

func (s *Labels) SetData(val []string)

SetData sets the value of Data.

func (*Labels) SetStatus

func (s *Labels) SetStatus(val string)

SetStatus sets the value of Status.

func (*Labels) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Labels) Validate

func (s *Labels) Validate() error

type LabelsParams

type LabelsParams struct {
	// The start time for the query as a nanosecond Unix epoch.
	// Defaults to 6 hours ago.
	Start OptLokiTime `json:",omitempty,omitzero"`
	// The end time for the query as a nanosecond Unix epoch.
	// Defaults to now.
	End OptLokiTime `json:",omitempty,omitzero"`
	// A `duration` used to calculate `start` relative to `end`.
	// If `end` is in the future, `start` is calculated as this duration before now.
	// Any value specified for start supersedes this parameter.
	Since OptPrometheusDuration `json:",omitempty,omitzero"`
}

LabelsParams is parameters of labels operation.

type LogEntry

type LogEntry struct {
	T uint64
	V string
}

Ref: #/components/schemas/LogEntry

func (*LogEntry) Decode

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

Decode decodes LogEntry from json.

func (*LogEntry) Encode

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

Encode implements json.Marshaler.

func (*LogEntry) GetT

func (s *LogEntry) GetT() uint64

GetT returns the value of T.

func (*LogEntry) GetV

func (s *LogEntry) GetV() string

GetV returns the value of V.

func (*LogEntry) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*LogEntry) SetT

func (s *LogEntry) SetT(val uint64)

SetT sets the value of T.

func (*LogEntry) SetV

func (s *LogEntry) SetV(val string)

SetV sets the value of V.

func (*LogEntry) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type LokiTime

type LokiTime string

type Maps

type Maps struct {
	Data   []MapsDataItem `json:"data"`
	Status string         `json:"status"`
}

Array of maps. Ref: #/components/schemas/Maps

func (*Maps) Decode

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

Decode decodes Maps from json.

func (*Maps) Encode

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

Encode implements json.Marshaler.

func (*Maps) GetData

func (s *Maps) GetData() []MapsDataItem

GetData returns the value of Data.

func (*Maps) GetStatus

func (s *Maps) GetStatus() string

GetStatus returns the value of Status.

func (*Maps) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Maps) SetData

func (s *Maps) SetData(val []MapsDataItem)

SetData sets the value of Data.

func (*Maps) SetStatus

func (s *Maps) SetStatus(val string)

SetStatus sets the value of Status.

func (*Maps) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Maps) Validate

func (s *Maps) Validate() error

type MapsDataItem

type MapsDataItem map[string]string

func (*MapsDataItem) Decode

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

Decode decodes MapsDataItem from json.

func (MapsDataItem) Encode

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

Encode implements json.Marshaler.

func (MapsDataItem) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*MapsDataItem) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Matrix

type Matrix []Series

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 encodes Matrix as json.

func (Matrix) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Matrix) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (Matrix) Validate

func (s Matrix) Validate() error

type MatrixResult

type MatrixResult struct {
	Result Matrix `json:"result"`
	Stats  *Stats `json:"stats"`
}

Ref: #/components/schemas/MatrixResult

func (*MatrixResult) Decode

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

Decode decodes MatrixResult from json.

func (*MatrixResult) Encode

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

Encode implements json.Marshaler.

func (*MatrixResult) GetResult

func (s *MatrixResult) GetResult() Matrix

GetResult returns the value of Result.

func (*MatrixResult) GetStats

func (s *MatrixResult) GetStats() *Stats

GetStats returns the value of Stats.

func (*MatrixResult) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*MatrixResult) SetResult

func (s *MatrixResult) SetResult(val Matrix)

SetResult sets the value of Result.

func (*MatrixResult) SetStats

func (s *MatrixResult) SetStats(val *Stats)

SetStats sets the value of Stats.

func (*MatrixResult) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MatrixResult) Validate

func (s *MatrixResult) Validate() error

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OperationName added in v0.16.0

type OperationName = string

OperationName is the ogen operation name

const (
	DetectedFieldValuesOperation OperationName = "DetectedFieldValues"
	DetectedFieldsOperation      OperationName = "DetectedFields"
	DetectedLabelsOperation      OperationName = "DetectedLabels"
	DrilldownLimitsOperation     OperationName = "DrilldownLimits"
	IndexStatsOperation          OperationName = "IndexStats"
	LabelValuesOperation         OperationName = "LabelValues"
	LabelsOperation              OperationName = "Labels"
	PatternsOperation            OperationName = "Patterns"
	PushOperation                OperationName = "Push"
	QueryOperation               OperationName = "Query"
	QueryRangeOperation          OperationName = "QueryRange"
	QueryVolumeOperation         OperationName = "QueryVolume"
	QueryVolumeRangeOperation    OperationName = "QueryVolumeRange"
	SeriesOperation              OperationName = "Series"
)

type OptBool added in v0.40.0

type OptBool struct {
	Value bool
	Set   bool
}

OptBool is optional bool.

func NewOptBool added in v0.40.0

func NewOptBool(v bool) OptBool

NewOptBool returns new OptBool with value set to v.

func (*OptBool) Decode added in v0.40.0

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

Decode decodes bool from json.

func (OptBool) Encode added in v0.40.0

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

Encode encodes bool as json.

func (OptBool) Get added in v0.40.0

func (o OptBool) Get() (v bool, ok bool)

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

func (OptBool) IsSet added in v0.40.0

func (o OptBool) IsSet() bool

IsSet returns true if OptBool was set.

func (OptBool) MarshalJSON added in v0.40.0

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

MarshalJSON implements stdjson.Marshaler.

func (OptBool) Or added in v0.40.0

func (o OptBool) Or(d bool) bool

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

func (*OptBool) Reset added in v0.40.0

func (o *OptBool) Reset()

Reset unsets value.

func (*OptBool) SetTo added in v0.40.0

func (o *OptBool) SetTo(v bool)

SetTo sets value to v.

func (*OptBool) UnmarshalJSON added in v0.40.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptDirection

type OptDirection struct {
	Value Direction
	Set   bool
}

OptDirection is optional Direction.

func NewOptDirection

func NewOptDirection(v Direction) OptDirection

NewOptDirection returns new OptDirection with value set to v.

func (OptDirection) Get

func (o OptDirection) Get() (v Direction, ok bool)

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

func (OptDirection) IsSet

func (o OptDirection) IsSet() bool

IsSet returns true if OptDirection was set.

func (OptDirection) Or

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

func (*OptDirection) Reset

func (o *OptDirection) Reset()

Reset unsets value.

func (*OptDirection) SetTo

func (o *OptDirection) SetTo(v Direction)

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

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

Decode decodes int from json.

func (OptInt) Encode added in v0.40.0

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

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

func (o *OptInt) SetTo(v int)

SetTo sets value to v.

func (*OptInt) UnmarshalJSON added in v0.40.0

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

type OptLokiTime struct {
	Value LokiTime
	Set   bool
}

OptLokiTime is optional LokiTime.

func NewOptLokiTime

func NewOptLokiTime(v LokiTime) OptLokiTime

NewOptLokiTime returns new OptLokiTime with value set to v.

func (OptLokiTime) Get

func (o OptLokiTime) Get() (v LokiTime, ok bool)

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

func (OptLokiTime) IsSet

func (o OptLokiTime) IsSet() bool

IsSet returns true if OptLokiTime was set.

func (OptLokiTime) Or

func (o OptLokiTime) Or(d LokiTime) LokiTime

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

func (*OptLokiTime) Reset

func (o *OptLokiTime) Reset()

Reset unsets value.

func (*OptLokiTime) SetTo

func (o *OptLokiTime) SetTo(v LokiTime)

SetTo sets value to v.

type OptNilStringArray added in v0.40.0

type OptNilStringArray struct {
	Value []string
	Set   bool
	Null  bool
}

OptNilStringArray is optional nullable []string.

func NewOptNilStringArray added in v0.40.0

func NewOptNilStringArray(v []string) OptNilStringArray

NewOptNilStringArray returns new OptNilStringArray with value set to v.

func (*OptNilStringArray) Decode added in v0.40.0

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

Decode decodes []string from json.

func (OptNilStringArray) Encode added in v0.40.0

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

Encode encodes []string as json.

func (OptNilStringArray) Get added in v0.40.0

func (o OptNilStringArray) Get() (v []string, ok bool)

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

func (OptNilStringArray) IsNull added in v0.40.0

func (o OptNilStringArray) IsNull() bool

IsNull returns true if value is Null.

func (OptNilStringArray) IsSet added in v0.40.0

func (o OptNilStringArray) IsSet() bool

IsSet returns true if OptNilStringArray was set.

func (OptNilStringArray) MarshalJSON added in v0.40.0

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

MarshalJSON implements stdjson.Marshaler.

func (OptNilStringArray) Or added in v0.40.0

func (o OptNilStringArray) Or(d []string) []string

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

func (*OptNilStringArray) Reset added in v0.40.0

func (o *OptNilStringArray) Reset()

Reset unsets value.

func (*OptNilStringArray) SetTo added in v0.40.0

func (o *OptNilStringArray) SetTo(v []string)

SetTo sets value to v.

func (*OptNilStringArray) SetToNull added in v0.40.0

func (o *OptNilStringArray) SetToNull()

SetToNull sets value to null.

func (*OptNilStringArray) UnmarshalJSON added in v0.40.0

func (s *OptNilStringArray) 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 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 added in v0.40.0

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

Decode decodes string from json.

func (OptString) Encode added in v0.40.0

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

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

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON added in v0.40.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptUint64 added in v0.40.0

type OptUint64 struct {
	Value uint64
	Set   bool
}

OptUint64 is optional uint64.

func NewOptUint64 added in v0.40.0

func NewOptUint64(v uint64) OptUint64

NewOptUint64 returns new OptUint64 with value set to v.

func (*OptUint64) Decode added in v0.40.0

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

Decode decodes uint64 from json.

func (OptUint64) Encode added in v0.40.0

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

Encode encodes uint64 as json.

func (OptUint64) Get added in v0.40.0

func (o OptUint64) Get() (v uint64, ok bool)

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

func (OptUint64) IsSet added in v0.40.0

func (o OptUint64) IsSet() bool

IsSet returns true if OptUint64 was set.

func (OptUint64) MarshalJSON added in v0.40.0

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

MarshalJSON implements stdjson.Marshaler.

func (OptUint64) Or added in v0.40.0

func (o OptUint64) Or(d uint64) uint64

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

func (*OptUint64) Reset added in v0.40.0

func (o *OptUint64) Reset()

Reset unsets value.

func (*OptUint64) SetTo added in v0.40.0

func (o *OptUint64) SetTo(v uint64)

SetTo sets value to v.

func (*OptUint64) UnmarshalJSON added in v0.40.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithAttributes added in v0.21.0

func WithAttributes(attributes ...attribute.KeyValue) Option

WithAttributes specifies default otel attributes.

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

type PatternSample struct {
	T float64
	V int
}

Ref: #/components/schemas/PatternSample

func (*PatternSample) Decode added in v0.40.0

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

Decode decodes PatternSample from json.

func (*PatternSample) Encode added in v0.40.0

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

Encode implements json.Marshaler.

func (*PatternSample) GetT added in v0.40.0

func (s *PatternSample) GetT() float64

GetT returns the value of T.

func (*PatternSample) GetV added in v0.40.0

func (s *PatternSample) GetV() int

GetV returns the value of V.

func (*PatternSample) MarshalJSON added in v0.40.0

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

MarshalJSON implements stdjson.Marshaler.

func (*PatternSample) SetT added in v0.40.0

func (s *PatternSample) SetT(val float64)

SetT sets the value of T.

func (*PatternSample) SetV added in v0.40.0

func (s *PatternSample) SetV(val int)

SetV sets the value of V.

func (*PatternSample) UnmarshalJSON added in v0.40.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PatternSample) Validate added in v0.40.0

func (s *PatternSample) Validate() error

type PatternSeries added in v0.40.0

type PatternSeries struct {
	Pattern string          `json:"pattern"`
	Samples []PatternSample `json:"samples"`
	Level   string          `json:"level"`
}

Ref: #/components/schemas/PatternSeries

func (*PatternSeries) Decode added in v0.40.0

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

Decode decodes PatternSeries from json.

func (*PatternSeries) Encode added in v0.40.0

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

Encode implements json.Marshaler.

func (*PatternSeries) GetLevel added in v0.40.0

func (s *PatternSeries) GetLevel() string

GetLevel returns the value of Level.

func (*PatternSeries) GetPattern added in v0.40.0

func (s *PatternSeries) GetPattern() string

GetPattern returns the value of Pattern.

func (*PatternSeries) GetSamples added in v0.40.0

func (s *PatternSeries) GetSamples() []PatternSample

GetSamples returns the value of Samples.

func (*PatternSeries) MarshalJSON added in v0.40.0

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

MarshalJSON implements stdjson.Marshaler.

func (*PatternSeries) SetLevel added in v0.40.0

func (s *PatternSeries) SetLevel(val string)

SetLevel sets the value of Level.

func (*PatternSeries) SetPattern added in v0.40.0

func (s *PatternSeries) SetPattern(val string)

SetPattern sets the value of Pattern.

func (*PatternSeries) SetSamples added in v0.40.0

func (s *PatternSeries) SetSamples(val []PatternSample)

SetSamples sets the value of Samples.

func (*PatternSeries) UnmarshalJSON added in v0.40.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PatternSeries) Validate added in v0.40.0

func (s *PatternSeries) Validate() error

type Patterns added in v0.40.0

type Patterns struct {
	Series []PatternSeries `json:"series"`
}

Ref: #/components/schemas/Patterns

func (*Patterns) Decode added in v0.40.0

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

Decode decodes Patterns from json.

func (*Patterns) Encode added in v0.40.0

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

Encode implements json.Marshaler.

func (*Patterns) GetSeries added in v0.40.0

func (s *Patterns) GetSeries() []PatternSeries

GetSeries returns the value of Series.

func (*Patterns) MarshalJSON added in v0.40.0

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

MarshalJSON implements stdjson.Marshaler.

func (*Patterns) SetSeries added in v0.40.0

func (s *Patterns) SetSeries(val []PatternSeries)

SetSeries sets the value of Series.

func (*Patterns) UnmarshalJSON added in v0.40.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Patterns) Validate added in v0.40.0

func (s *Patterns) Validate() error

type PatternsParams added in v0.40.0

type PatternsParams struct {
	Start OptLokiTime `json:",omitempty,omitzero"`
	End   OptLokiTime `json:",omitempty,omitzero"`
	// A `duration` used to calculate `start` relative to `end`.
	// If `end` is in the future, `start` is calculated as this duration before now.
	// Any value specified for start supersedes this parameter.
	Since OptPrometheusDuration `json:",omitempty,omitzero"`
	// The LogQL query to perform.
	Query string
	// Query resolution step width in `duration` format or float number of seconds.
	// `duration` refers to Prometheus duration strings of the form `[0-9]+[smhdwy]`.
	// For example, `5m` refers to a duration of 5 minutes.
	// Defaults to a dynamic value based on start and end.
	Step OptPrometheusDuration `json:",omitempty,omitzero"`
}

PatternsParams is parameters of patterns operation.

type PrometheusDuration

type PrometheusDuration string

func (PrometheusDuration) Validate

func (s PrometheusDuration) Validate() error

type Push

type Push struct {
	Streams []Stream `json:"streams"`
}

Ref: #/components/schemas/Push

func (*Push) Decode

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

Decode decodes Push from json.

func (*Push) Encode

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

Encode implements json.Marshaler.

func (*Push) GetStreams

func (s *Push) GetStreams() []Stream

GetStreams returns the value of Streams.

func (*Push) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Push) SetStreams

func (s *Push) SetStreams(val []Stream)

SetStreams sets the value of Streams.

func (*Push) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Push) Validate

func (s *Push) Validate() error

type PushNoContent

type PushNoContent struct{}

PushNoContent is response for Push operation.

type PushReq

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

type PushReqApplicationXProtobuf

type PushReqApplicationXProtobuf struct {
	Data io.Reader
}

func (PushReqApplicationXProtobuf) Read

func (s PushReqApplicationXProtobuf) Read(p []byte) (n int, err error)

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

type QueryParams

type QueryParams struct {
	// The LogQL query to perform.
	Query string
	// The max number of entries to return.
	// It defaults to `100`.
	// Only applies to query types which produce a stream (log lines) response.
	Limit OptInt `json:",omitempty,omitzero"`
	// The evaluation time for the query as a nanosecond Unix epoch or another supported format.
	// Defaults to now.
	Time OptLokiTime `json:",omitempty,omitzero"`
	// Determines the sort order of logs.
	// Supported values are `forward` or `backward`.
	// Defaults to `backward`.
	Direction OptDirection `json:",omitempty,omitzero"`
}

QueryParams is parameters of query operation.

type QueryRangeParams

type QueryRangeParams struct {
	Start OptLokiTime `json:",omitempty,omitzero"`
	End   OptLokiTime `json:",omitempty,omitzero"`
	// A `duration` used to calculate `start` relative to `end`.
	// If `end` is in the future, `start` is calculated as this duration before now.
	// Any value specified for start supersedes this parameter.
	Since OptPrometheusDuration `json:",omitempty,omitzero"`
	// The LogQL query to perform.
	Query string
	// Query resolution step width in `duration` format or float number of seconds.
	// `duration` refers to Prometheus duration strings of the form `[0-9]+[smhdwy]`.
	// For example, `5m` refers to a duration of 5 minutes.
	// Defaults to a dynamic value based on start and end.
	// Only applies to query types which produce a matrix response.
	Step OptPrometheusDuration `json:",omitempty,omitzero"`
	// The max number of entries to return.
	// It defaults to `100`.
	// Only applies to query types which produce a stream (log lines) response.
	Limit OptInt `json:",omitempty,omitzero"`
	// Determines the sort order of logs.
	// Supported values are `forward` or `backward`.
	// Defaults to `backward`.
	Direction OptDirection `json:",omitempty,omitzero"`
}

QueryRangeParams is parameters of queryRange operation.

type QueryResponse

type QueryResponse struct {
	Status string            `json:"status"`
	Data   QueryResponseData `json:"data"`
}

Ref: #/components/schemas/QueryResponse

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() QueryResponseData

GetData returns the value of Data.

func (*QueryResponse) GetStatus

func (s *QueryResponse) GetStatus() string

GetStatus returns the value of Status.

func (*QueryResponse) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*QueryResponse) SetData

func (s *QueryResponse) SetData(val QueryResponseData)

SetData sets the value of Data.

func (*QueryResponse) SetStatus

func (s *QueryResponse) SetStatus(val string)

SetStatus sets the value of Status.

func (*QueryResponse) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*QueryResponse) Validate

func (s *QueryResponse) Validate() error

type QueryResponseData

type QueryResponseData struct {
	Type          QueryResponseDataType // switch on this field
	StreamsResult StreamsResult
	ScalarResult  ScalarResult
	VectorResult  VectorResult
	MatrixResult  MatrixResult
}

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

func NewMatrixResultQueryResponseData

func NewMatrixResultQueryResponseData(v MatrixResult) QueryResponseData

NewMatrixResultQueryResponseData returns new QueryResponseData from MatrixResult.

func NewScalarResultQueryResponseData

func NewScalarResultQueryResponseData(v ScalarResult) QueryResponseData

NewScalarResultQueryResponseData returns new QueryResponseData from ScalarResult.

func NewStreamsResultQueryResponseData

func NewStreamsResultQueryResponseData(v StreamsResult) QueryResponseData

NewStreamsResultQueryResponseData returns new QueryResponseData from StreamsResult.

func NewVectorResultQueryResponseData

func NewVectorResultQueryResponseData(v VectorResult) QueryResponseData

NewVectorResultQueryResponseData returns new QueryResponseData from VectorResult.

func (*QueryResponseData) Decode

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

Decode decodes QueryResponseData from json.

func (QueryResponseData) Encode

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

Encode encodes QueryResponseData as json.

func (QueryResponseData) GetMatrixResult

func (s QueryResponseData) GetMatrixResult() (v MatrixResult, ok bool)

GetMatrixResult returns MatrixResult and true boolean if QueryResponseData is MatrixResult.

func (QueryResponseData) GetScalarResult

func (s QueryResponseData) GetScalarResult() (v ScalarResult, ok bool)

GetScalarResult returns ScalarResult and true boolean if QueryResponseData is ScalarResult.

func (QueryResponseData) GetStreamsResult

func (s QueryResponseData) GetStreamsResult() (v StreamsResult, ok bool)

GetStreamsResult returns StreamsResult and true boolean if QueryResponseData is StreamsResult.

func (QueryResponseData) GetVectorResult

func (s QueryResponseData) GetVectorResult() (v VectorResult, ok bool)

GetVectorResult returns VectorResult and true boolean if QueryResponseData is VectorResult.

func (QueryResponseData) IsMatrixResult

func (s QueryResponseData) IsMatrixResult() bool

IsMatrixResult reports whether QueryResponseData is MatrixResult.

func (QueryResponseData) IsScalarResult

func (s QueryResponseData) IsScalarResult() bool

IsScalarResult reports whether QueryResponseData is ScalarResult.

func (QueryResponseData) IsStreamsResult

func (s QueryResponseData) IsStreamsResult() bool

IsStreamsResult reports whether QueryResponseData is StreamsResult.

func (QueryResponseData) IsVectorResult

func (s QueryResponseData) IsVectorResult() bool

IsVectorResult reports whether QueryResponseData is VectorResult.

func (QueryResponseData) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*QueryResponseData) SetMatrixResult

func (s *QueryResponseData) SetMatrixResult(v MatrixResult)

SetMatrixResult sets QueryResponseData to MatrixResult.

func (*QueryResponseData) SetScalarResult

func (s *QueryResponseData) SetScalarResult(v ScalarResult)

SetScalarResult sets QueryResponseData to ScalarResult.

func (*QueryResponseData) SetStreamsResult

func (s *QueryResponseData) SetStreamsResult(v StreamsResult)

SetStreamsResult sets QueryResponseData to StreamsResult.

func (*QueryResponseData) SetVectorResult

func (s *QueryResponseData) SetVectorResult(v VectorResult)

SetVectorResult sets QueryResponseData to VectorResult.

func (*QueryResponseData) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (QueryResponseData) Validate

func (s QueryResponseData) Validate() error

type QueryResponseDataType

type QueryResponseDataType string

QueryResponseDataType is oneOf type of QueryResponseData.

const (
	StreamsResultQueryResponseData QueryResponseDataType = "streams"
	ScalarResultQueryResponseData  QueryResponseDataType = "scalar"
	VectorResultQueryResponseData  QueryResponseDataType = "vector"
	MatrixResultQueryResponseData  QueryResponseDataType = "matrix"
)

Possible values for QueryResponseDataType.

type QueryVolumeParams added in v0.40.0

type QueryVolumeParams struct {
	// The LogQL matchers to check (that is, `{job="foo", env=~".+"}`).
	Query OptString `json:",omitempty,omitzero"`
	// Start timestamp.
	Start OptLokiTime `json:",omitempty,omitzero"`
	// End timestamp.
	End OptLokiTime `json:",omitempty,omitzero"`
	// A `duration` used to calculate `start` relative to `end`.
	// If `end` is in the future, `start` is calculated as this duration before now.
	// Any value specified for start supersedes this parameter.
	Since OptPrometheusDuration `json:",omitempty,omitzero"`
	// How many metric series to return.
	// The parameter is optional, the default is `100`.
	Limit OptInt `json:",omitempty,omitzero"`
	// A comma separated list of labels to aggregate into.
	// When not provided, volumes will be aggregated into the matching labels or label-value pairs.
	TargetLabels OptString `json:",omitempty,omitzero"`
	// Whether to aggregate into labels or label-value pairs.
	// This parameter is optional, the default is label-value pairs.
	AggregateBy OptString `json:",omitempty,omitzero"`
}

QueryVolumeParams is parameters of queryVolume operation.

type QueryVolumeRangeParams added in v0.40.0

type QueryVolumeRangeParams struct {
	// The LogQL matchers to check (that is, `{job="foo", env=~".+"}`).
	Query OptString `json:",omitempty,omitzero"`
	// Start timestamp.
	Start OptLokiTime `json:",omitempty,omitzero"`
	// End timestamp.
	End OptLokiTime `json:",omitempty,omitzero"`
	// A `duration` used to calculate `start` relative to `end`.
	// If `end` is in the future, `start` is calculated as this duration before now.
	// Any value specified for start supersedes this parameter.
	Since OptPrometheusDuration `json:",omitempty,omitzero"`
	// Query resolution step width in duration format or float number of seconds.
	// `duration` refers to Prometheus duration strings of the form `[0-9]+[smhdwy]`.
	// For example, `5m` refers to a duration of 5 minutes.
	// Defaults to a dynamic value based on `start` and `end`.
	// Only applies when querying the `volume_range` endpoint, which will always return a Prometheus
	// style matrix response.
	// The default step configured for range queries will be used when not provided.
	Step OptPrometheusDuration `json:",omitempty,omitzero"`
	// How many metric series to return.
	// The parameter is optional, the default is `100`.
	Limit OptInt `json:",omitempty,omitzero"`
	// A comma separated list of labels to aggregate into.
	// When not provided, volumes will be aggregated into the matching labels or label-value pairs.
	TargetLabels OptString `json:",omitempty,omitzero"`
	// Whether to aggregate into labels or label-value pairs.
	// This parameter is optional, the default is label-value pairs.
	AggregateBy OptString `json:",omitempty,omitzero"`
}

QueryVolumeRangeParams is parameters of queryVolumeRange operation.

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) OperationGroup added in v0.32.0

func (r Route) OperationGroup() string

OperationGroup returns the x-ogen-operation-group value.

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

type Sample struct {
	Metric OptLabelSet `json:"metric"`
	Value  FPoint      `json:"value"`
}

Ref: #/components/schemas/Sample

func (*Sample) Decode added in v0.0.8

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

Decode decodes Sample from json.

func (*Sample) Encode added in v0.0.8

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

Encode implements json.Marshaler.

func (*Sample) GetMetric added in v0.0.8

func (s *Sample) GetMetric() OptLabelSet

GetMetric returns the value of Metric.

func (*Sample) GetValue added in v0.0.8

func (s *Sample) GetValue() FPoint

GetValue returns the value of Value.

func (*Sample) MarshalJSON added in v0.0.8

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

MarshalJSON implements stdjson.Marshaler.

func (*Sample) SetMetric added in v0.0.8

func (s *Sample) SetMetric(val OptLabelSet)

SetMetric sets the value of Metric.

func (*Sample) SetValue added in v0.0.8

func (s *Sample) SetValue(val FPoint)

SetValue sets the value of Value.

func (*Sample) UnmarshalJSON added in v0.0.8

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Sample) Validate added in v0.0.8

func (s *Sample) Validate() error

type ScalarResult

type ScalarResult struct {
	Result FPoint `json:"result"`
	Stats  *Stats `json:"stats"`
}

Ref: #/components/schemas/ScalarResult

func (*ScalarResult) Decode

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

Decode decodes ScalarResult from json.

func (*ScalarResult) Encode

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

Encode implements json.Marshaler.

func (*ScalarResult) GetResult

func (s *ScalarResult) GetResult() FPoint

GetResult returns the value of Result.

func (*ScalarResult) GetStats

func (s *ScalarResult) GetStats() *Stats

GetStats returns the value of Stats.

func (*ScalarResult) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ScalarResult) SetResult

func (s *ScalarResult) SetResult(val FPoint)

SetResult sets the value of Result.

func (*ScalarResult) SetStats

func (s *ScalarResult) SetStats(val *Stats)

SetStats sets the value of Stats.

func (*ScalarResult) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ScalarResult) Validate

func (s *ScalarResult) Validate() error

type Series

type Series struct {
	Metric OptLabelSet `json:"metric"`
	Values []FPoint    `json:"values"`
}

Ref: #/components/schemas/Series

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 implements json.Marshaler.

func (*Series) GetMetric

func (s *Series) GetMetric() OptLabelSet

GetMetric returns the value of Metric.

func (*Series) GetValues

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

GetValues returns the value of Values.

func (*Series) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Series) SetMetric

func (s *Series) SetMetric(val OptLabelSet)

SetMetric sets the value of Metric.

func (*Series) SetValues

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

SetValues sets the value of Values.

func (*Series) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Series) Validate

func (s *Series) Validate() error

type SeriesParams

type SeriesParams struct {
	Start OptLokiTime `json:",omitempty,omitzero"`
	End   OptLokiTime `json:",omitempty,omitzero"`
	// A `duration` used to calculate `start` relative to `end`.
	// If `end` is in the future, `start` is calculated as this duration before now.
	// Any value specified for start supersedes this parameter.
	Since OptPrometheusDuration `json:",omitempty,omitzero"`
	Match []string              `json:",omitempty"`
}

SeriesParams is parameters of series operation.

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 Stats

type Stats struct{}

Ref: #/components/schemas/Stats

func (*Stats) Decode

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

Decode decodes Stats from json.

func (*Stats) Encode

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

Encode implements json.Marshaler.

func (*Stats) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Stats) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Stream

type Stream struct {
	Stream OptLabelSet `json:"stream"`
	Values []LogEntry  `json:"values"`
}

Ref: #/components/schemas/Stream

func (*Stream) Decode

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

Decode decodes Stream from json.

func (*Stream) Encode

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

Encode implements json.Marshaler.

func (*Stream) GetStream

func (s *Stream) GetStream() OptLabelSet

GetStream returns the value of Stream.

func (*Stream) GetValues

func (s *Stream) GetValues() []LogEntry

GetValues returns the value of Values.

func (*Stream) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Stream) SetStream

func (s *Stream) SetStream(val OptLabelSet)

SetStream sets the value of Stream.

func (*Stream) SetValues

func (s *Stream) SetValues(val []LogEntry)

SetValues sets the value of Values.

func (*Stream) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Stream) Validate

func (s *Stream) Validate() error

type Streams

type Streams []Stream

func (*Streams) Decode

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

Decode decodes Streams from json.

func (Streams) Encode

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

Encode encodes Streams as json.

func (Streams) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Streams) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (Streams) Validate

func (s Streams) Validate() error

type StreamsResult

type StreamsResult struct {
	Result Streams `json:"result"`
	Stats  *Stats  `json:"stats"`
}

Ref: #/components/schemas/StreamsResult

func (*StreamsResult) Decode

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

Decode decodes StreamsResult from json.

func (*StreamsResult) Encode

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

Encode implements json.Marshaler.

func (*StreamsResult) GetResult

func (s *StreamsResult) GetResult() Streams

GetResult returns the value of Result.

func (*StreamsResult) GetStats

func (s *StreamsResult) GetStats() *Stats

GetStats returns the value of Stats.

func (*StreamsResult) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*StreamsResult) SetResult

func (s *StreamsResult) SetResult(val Streams)

SetResult sets the value of Result.

func (*StreamsResult) SetStats

func (s *StreamsResult) SetStats(val *Stats)

SetStats sets the value of Stats.

func (*StreamsResult) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*StreamsResult) Validate

func (s *StreamsResult) Validate() error

type UnimplementedHandler

type UnimplementedHandler struct{}

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

func (UnimplementedHandler) DetectedFieldValues added in v0.40.0

DetectedFieldValues implements detectedFieldValues operation.

Get detected field values.

GET /loki/api/v1/detected_field/{field}/values

func (UnimplementedHandler) DetectedFields added in v0.40.0

func (UnimplementedHandler) DetectedFields(ctx context.Context, params DetectedFieldsParams) (r *DetectedFields, _ error)

DetectedFields implements detectedFields operation.

Get detected fields.

GET /loki/api/v1/detected_fields

func (UnimplementedHandler) DetectedLabels added in v0.40.0

func (UnimplementedHandler) DetectedLabels(ctx context.Context, params DetectedLabelsParams) (r *DetectedLabels, _ error)

DetectedLabels implements detectedLabels operation.

Get detected labels. Used by Grafana to test Logs Drilldown availability.

GET /loki/api/v1/detected_labels

func (UnimplementedHandler) DrilldownLimits added in v0.40.0

func (UnimplementedHandler) DrilldownLimits(ctx context.Context) (r *DrilldownLimits, _ error)

DrilldownLimits implements drilldownLimits operation.

Get drilldown limits. Used by Grafana to get limits from Loki.

GET /loki/api/v1/drilldown-limits

func (UnimplementedHandler) IndexStats added in v0.1.0

func (UnimplementedHandler) IndexStats(ctx context.Context, params IndexStatsParams) (r *IndexStats, _ error)

IndexStats implements indexStats operation.

Get index stats.

GET /loki/api/v1/index/stats

func (UnimplementedHandler) LabelValues

func (UnimplementedHandler) LabelValues(ctx context.Context, params LabelValuesParams) (r *Values, _ error)

LabelValues implements labelValues operation.

Get values of label.

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

func (UnimplementedHandler) Labels

func (UnimplementedHandler) Labels(ctx context.Context, params LabelsParams) (r *Labels, _ error)

Labels implements labels operation.

Get labels. Used by Grafana to test connection to Loki.

GET /loki/api/v1/labels

func (UnimplementedHandler) NewError

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

NewError creates *ErrorStatusCode from error returned by handler.

Used for common default response.

func (UnimplementedHandler) Patterns added in v0.40.0

func (UnimplementedHandler) Patterns(ctx context.Context, params PatternsParams) (r *Patterns, _ error)

Patterns implements patterns operation.

Endpoint can be used to query loki for patterns detected in the logs. This helps understand the structure of the logs Loki has ingested.

GET /loki/api/v1/patterns

func (UnimplementedHandler) Push

Push implements push operation.

Push data.

POST /loki/api/v1/push

func (UnimplementedHandler) Query

Query implements query operation.

Query.

GET /loki/api/v1/query

func (UnimplementedHandler) QueryRange

func (UnimplementedHandler) QueryRange(ctx context.Context, params QueryRangeParams) (r *QueryResponse, _ error)

QueryRange implements queryRange operation.

Query range.

GET /loki/api/v1/query_range

func (UnimplementedHandler) QueryVolume added in v0.40.0

func (UnimplementedHandler) QueryVolume(ctx context.Context, params QueryVolumeParams) (r *QueryResponse, _ error)

QueryVolume implements queryVolume operation.

Query the index for volume information about label and label-value combinations.

GET /loki/api/v1/index/volume

func (UnimplementedHandler) QueryVolumeRange added in v0.40.0

func (UnimplementedHandler) QueryVolumeRange(ctx context.Context, params QueryVolumeRangeParams) (r *QueryResponse, _ error)

QueryVolumeRange implements queryVolumeRange operation.

Query the index for volume information about label and label-value combinations.

GET /loki/api/v1/index/volume_range

func (UnimplementedHandler) Series

func (UnimplementedHandler) Series(ctx context.Context, params SeriesParams) (r *Maps, _ error)

Series implements series operation.

Get series.

GET /loki/api/v1/series

type Values

type Values struct {
	Data   []string `json:"data"`
	Status string   `json:"status"`
}

Array of strings. Ref: #/components/schemas/Values

func (*Values) Decode

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

Decode decodes Values from json.

func (*Values) Encode

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

Encode implements json.Marshaler.

func (*Values) GetData

func (s *Values) GetData() []string

GetData returns the value of Data.

func (*Values) GetStatus

func (s *Values) GetStatus() string

GetStatus returns the value of Status.

func (*Values) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Values) SetData

func (s *Values) SetData(val []string)

SetData sets the value of Data.

func (*Values) SetStatus

func (s *Values) SetStatus(val string)

SetStatus sets the value of Status.

func (*Values) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Values) Validate

func (s *Values) Validate() error

type Vector

type Vector []Sample

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 encodes Vector as json.

func (Vector) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Vector) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (Vector) Validate

func (s Vector) Validate() error

type VectorResult

type VectorResult struct {
	Result Vector `json:"result"`
	Stats  *Stats `json:"stats"`
}

Ref: #/components/schemas/VectorResult

func (*VectorResult) Decode

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

Decode decodes VectorResult from json.

func (*VectorResult) Encode

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

Encode implements json.Marshaler.

func (*VectorResult) GetResult

func (s *VectorResult) GetResult() Vector

GetResult returns the value of Result.

func (*VectorResult) GetStats

func (s *VectorResult) GetStats() *Stats

GetStats returns the value of Stats.

func (*VectorResult) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*VectorResult) SetResult

func (s *VectorResult) SetResult(val Vector)

SetResult sets the value of Result.

func (*VectorResult) SetStats

func (s *VectorResult) SetStats(val *Stats)

SetStats sets the value of Stats.

func (*VectorResult) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*VectorResult) Validate

func (s *VectorResult) Validate() error

Jump to

Keyboard shortcuts

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