Documentation ¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Client
- func (c *Client) IndexStats(ctx context.Context, params IndexStatsParams) (*IndexStats, error)
- func (c *Client) LabelValues(ctx context.Context, params LabelValuesParams) (*Values, error)
- func (c *Client) Labels(ctx context.Context, params LabelsParams) (*Labels, error)
- func (c *Client) Push(ctx context.Context, request PushReq) error
- func (c *Client) Query(ctx context.Context, params QueryParams) (*QueryResponse, error)
- func (c *Client) QueryRange(ctx context.Context, params QueryRangeParams) (*QueryResponse, error)
- func (c *Client) Series(ctx context.Context, params SeriesParams) (*Maps, error)
- type ClientOption
- type Direction
- type Error
- type ErrorHandler
- type ErrorStatusCode
- type FPoint
- func (s *FPoint) Decode(d *jx.Decoder) error
- func (s *FPoint) Encode(e *jx.Encoder)
- func (s *FPoint) GetT() float64
- func (s *FPoint) GetV() string
- func (s *FPoint) MarshalJSON() ([]byte, error)
- func (s *FPoint) SetT(val float64)
- func (s *FPoint) SetV(val string)
- func (s *FPoint) UnmarshalJSON(data []byte) error
- func (s *FPoint) Validate() error
- type Handler
- type IndexStats
- func (s *IndexStats) Decode(d *jx.Decoder) error
- func (s *IndexStats) Encode(e *jx.Encoder)
- func (s *IndexStats) GetBytes() int
- func (s *IndexStats) GetChunks() int
- func (s *IndexStats) GetEntries() int
- func (s *IndexStats) GetStreams() int
- func (s *IndexStats) MarshalJSON() ([]byte, error)
- func (s *IndexStats) SetBytes(val int)
- func (s *IndexStats) SetChunks(val int)
- func (s *IndexStats) SetEntries(val int)
- func (s *IndexStats) SetStreams(val int)
- func (s *IndexStats) UnmarshalJSON(data []byte) error
- type IndexStatsParams
- type Invoker
- type LabelSet
- type LabelValuesParams
- type Labeler
- type Labels
- func (s *Labels) Decode(d *jx.Decoder) error
- func (s *Labels) Encode(e *jx.Encoder)
- func (s *Labels) GetData() []string
- func (s *Labels) GetStatus() string
- func (s *Labels) MarshalJSON() ([]byte, error)
- func (s *Labels) SetData(val []string)
- func (s *Labels) SetStatus(val string)
- func (s *Labels) UnmarshalJSON(data []byte) error
- func (s *Labels) Validate() error
- type LabelsParams
- type LogEntry
- func (s *LogEntry) Decode(d *jx.Decoder) error
- func (s *LogEntry) Encode(e *jx.Encoder)
- func (s *LogEntry) GetT() uint64
- func (s *LogEntry) GetV() string
- func (s *LogEntry) MarshalJSON() ([]byte, error)
- func (s *LogEntry) SetT(val uint64)
- func (s *LogEntry) SetV(val string)
- func (s *LogEntry) UnmarshalJSON(data []byte) error
- type LokiTime
- type Maps
- func (s *Maps) Decode(d *jx.Decoder) error
- func (s *Maps) Encode(e *jx.Encoder)
- func (s *Maps) GetData() []MapsDataItem
- func (s *Maps) GetStatus() string
- func (s *Maps) MarshalJSON() ([]byte, error)
- func (s *Maps) SetData(val []MapsDataItem)
- func (s *Maps) SetStatus(val string)
- func (s *Maps) UnmarshalJSON(data []byte) error
- func (s *Maps) Validate() error
- type MapsDataItem
- type Matrix
- type MatrixResult
- func (s *MatrixResult) Decode(d *jx.Decoder) error
- func (s *MatrixResult) Encode(e *jx.Encoder)
- func (s *MatrixResult) GetResult() Matrix
- func (s *MatrixResult) GetStats() *Stats
- func (s *MatrixResult) MarshalJSON() ([]byte, error)
- func (s *MatrixResult) SetResult(val Matrix)
- func (s *MatrixResult) SetStats(val *Stats)
- func (s *MatrixResult) UnmarshalJSON(data []byte) error
- func (s *MatrixResult) Validate() error
- type Middleware
- type OptDirection
- type OptInt
- type OptLabelSet
- func (o *OptLabelSet) Decode(d *jx.Decoder) error
- func (o OptLabelSet) Encode(e *jx.Encoder)
- func (o OptLabelSet) Get() (v LabelSet, ok bool)
- func (o OptLabelSet) IsSet() bool
- func (s OptLabelSet) MarshalJSON() ([]byte, error)
- func (o OptLabelSet) Or(d LabelSet) LabelSet
- func (o *OptLabelSet) Reset()
- func (o *OptLabelSet) SetTo(v LabelSet)
- func (s *OptLabelSet) UnmarshalJSON(data []byte) error
- type OptLokiTime
- type OptPrometheusDuration
- type OptString
- type Option
- type PrometheusDuration
- type Push
- type PushNoContent
- type PushReq
- type PushReqApplicationXProtobuf
- type QueryParams
- type QueryRangeParams
- type QueryResponse
- func (s *QueryResponse) Decode(d *jx.Decoder) error
- func (s *QueryResponse) Encode(e *jx.Encoder)
- func (s *QueryResponse) GetData() QueryResponseData
- func (s *QueryResponse) GetStatus() string
- func (s *QueryResponse) MarshalJSON() ([]byte, error)
- func (s *QueryResponse) SetData(val QueryResponseData)
- func (s *QueryResponse) SetStatus(val string)
- func (s *QueryResponse) UnmarshalJSON(data []byte) error
- func (s *QueryResponse) Validate() error
- type QueryResponseData
- func (s *QueryResponseData) Decode(d *jx.Decoder) error
- func (s QueryResponseData) Encode(e *jx.Encoder)
- func (s QueryResponseData) GetMatrixResult() (v MatrixResult, ok bool)
- func (s QueryResponseData) GetScalarResult() (v ScalarResult, ok bool)
- func (s QueryResponseData) GetStreamsResult() (v StreamsResult, ok bool)
- func (s QueryResponseData) GetVectorResult() (v VectorResult, ok bool)
- func (s QueryResponseData) IsMatrixResult() bool
- func (s QueryResponseData) IsScalarResult() bool
- func (s QueryResponseData) IsStreamsResult() bool
- func (s QueryResponseData) IsVectorResult() bool
- func (s QueryResponseData) MarshalJSON() ([]byte, error)
- func (s *QueryResponseData) SetMatrixResult(v MatrixResult)
- func (s *QueryResponseData) SetScalarResult(v ScalarResult)
- func (s *QueryResponseData) SetStreamsResult(v StreamsResult)
- func (s *QueryResponseData) SetVectorResult(v VectorResult)
- func (s *QueryResponseData) UnmarshalJSON(data []byte) error
- func (s QueryResponseData) Validate() error
- type QueryResponseDataType
- type Route
- type Sample
- func (s *Sample) Decode(d *jx.Decoder) error
- func (s *Sample) Encode(e *jx.Encoder)
- func (s *Sample) GetMetric() OptLabelSet
- func (s *Sample) GetValue() FPoint
- func (s *Sample) MarshalJSON() ([]byte, error)
- func (s *Sample) SetMetric(val OptLabelSet)
- func (s *Sample) SetValue(val FPoint)
- func (s *Sample) UnmarshalJSON(data []byte) error
- func (s *Sample) Validate() error
- type ScalarResult
- func (s *ScalarResult) Decode(d *jx.Decoder) error
- func (s *ScalarResult) Encode(e *jx.Encoder)
- func (s *ScalarResult) GetResult() FPoint
- func (s *ScalarResult) GetStats() *Stats
- func (s *ScalarResult) MarshalJSON() ([]byte, error)
- func (s *ScalarResult) SetResult(val FPoint)
- func (s *ScalarResult) SetStats(val *Stats)
- func (s *ScalarResult) UnmarshalJSON(data []byte) error
- func (s *ScalarResult) Validate() error
- type Series
- func (s *Series) Decode(d *jx.Decoder) error
- func (s *Series) Encode(e *jx.Encoder)
- func (s *Series) GetMetric() OptLabelSet
- func (s *Series) GetValues() []FPoint
- func (s *Series) MarshalJSON() ([]byte, error)
- func (s *Series) SetMetric(val OptLabelSet)
- func (s *Series) SetValues(val []FPoint)
- func (s *Series) UnmarshalJSON(data []byte) error
- func (s *Series) Validate() error
- type SeriesParams
- type Server
- type ServerOption
- func WithErrorHandler(h ErrorHandler) ServerOption
- func WithMaxMultipartMemory(max int64) ServerOption
- func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
- func WithMiddleware(m ...Middleware) ServerOption
- func WithNotFound(notFound http.HandlerFunc) ServerOption
- func WithPathPrefix(prefix string) ServerOption
- type Stats
- type Stream
- func (s *Stream) Decode(d *jx.Decoder) error
- func (s *Stream) Encode(e *jx.Encoder)
- func (s *Stream) GetStream() OptLabelSet
- func (s *Stream) GetValues() []LogEntry
- func (s *Stream) MarshalJSON() ([]byte, error)
- func (s *Stream) SetStream(val OptLabelSet)
- func (s *Stream) SetValues(val []LogEntry)
- func (s *Stream) UnmarshalJSON(data []byte) error
- func (s *Stream) Validate() error
- type Streams
- type StreamsResult
- func (s *StreamsResult) Decode(d *jx.Decoder) error
- func (s *StreamsResult) Encode(e *jx.Encoder)
- func (s *StreamsResult) GetResult() Streams
- func (s *StreamsResult) GetStats() *Stats
- func (s *StreamsResult) MarshalJSON() ([]byte, error)
- func (s *StreamsResult) SetResult(val Streams)
- func (s *StreamsResult) SetStats(val *Stats)
- func (s *StreamsResult) UnmarshalJSON(data []byte) error
- func (s *StreamsResult) Validate() error
- type UnimplementedHandler
- func (UnimplementedHandler) IndexStats(ctx context.Context, params IndexStatsParams) (r *IndexStats, _ error)
- func (UnimplementedHandler) LabelValues(ctx context.Context, params LabelValuesParams) (r *Values, _ error)
- func (UnimplementedHandler) Labels(ctx context.Context, params LabelsParams) (r *Labels, _ error)
- func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)
- func (UnimplementedHandler) Push(ctx context.Context, req PushReq) error
- func (UnimplementedHandler) Query(ctx context.Context, params QueryParams) (r *QueryResponse, _ error)
- func (UnimplementedHandler) QueryRange(ctx context.Context, params QueryRangeParams) (r *QueryResponse, _ error)
- func (UnimplementedHandler) Series(ctx context.Context, params SeriesParams) (r *Maps, _ error)
- type Values
- func (s *Values) Decode(d *jx.Decoder) error
- func (s *Values) Encode(e *jx.Encoder)
- func (s *Values) GetData() []string
- func (s *Values) GetStatus() string
- func (s *Values) MarshalJSON() ([]byte, error)
- func (s *Values) SetData(val []string)
- func (s *Values) SetStatus(val string)
- func (s *Values) UnmarshalJSON(data []byte) error
- func (s *Values) Validate() error
- type Vector
- type VectorResult
- func (s *VectorResult) Decode(d *jx.Decoder) error
- func (s *VectorResult) Encode(e *jx.Encoder)
- func (s *VectorResult) GetResult() Vector
- func (s *VectorResult) GetStats() *Stats
- func (s *VectorResult) MarshalJSON() ([]byte, error)
- func (s *VectorResult) SetResult(val Vector)
- func (s *VectorResult) SetStats(val *Stats)
- func (s *VectorResult) UnmarshalJSON(data []byte) error
- func (s *VectorResult) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) 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 ¶
LabelValues invokes labelValues operation.
Get values of label.
GET /loki/api/v1/label/{name}/values
func (*Client) Labels ¶
Labels invokes labels operation.
Get labels. Used by Grafana to test connection to Loki.
GET /loki/api/v1/labels
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
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 Direction ¶
type Direction string
Ref: #/components/schemas/Direction
func (Direction) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Direction) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Error ¶
type Error string
func (Error) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Error) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type ErrorStatusCode ¶
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
Ref: #/components/schemas/FPoint
func (*FPoint) MarshalJSON ¶ added in v0.0.8
MarshalJSON implements stdjson.Marshaler.
func (*FPoint) UnmarshalJSON ¶ added in v0.0.8
UnmarshalJSON implements stdjson.Unmarshaler.
type Handler ¶
type Handler interface { // 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) // 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) // 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 End OptLokiTime // The LogQL matchers to check. Query string }
IndexStatsParams is parameters of indexStats operation.
type Invoker ¶ added in v0.1.0
type Invoker interface { // 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) // 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) // 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 ¶
Ref: #/components/schemas/LabelSet
func (LabelSet) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*LabelSet) UnmarshalJSON ¶
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 // The end time for the query as a nanosecond Unix epoch. // Defaults to now. End OptLokiTime // 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 // A set of log stream selector that selects the streams to match and return label values for // `{name}`. Query OptString // 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
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) AttributeSet ¶ added in v0.10.0
AttributeSet returns the attributes added to the Labeler as an attribute.Set.
type Labels ¶
Array of label names. Ref: #/components/schemas/Labels
func (*Labels) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Labels) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type LabelsParams ¶
type LabelsParams struct { // The start time for the query as a nanosecond Unix epoch. // Defaults to 6 hours ago. Start OptLokiTime // The end time for the query as a nanosecond Unix epoch. // Defaults to now. End OptLokiTime // 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 }
LabelsParams is parameters of labels operation.
type LogEntry ¶
Ref: #/components/schemas/LogEntry
func (*LogEntry) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*LogEntry) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Maps ¶
type Maps struct { Data []MapsDataItem `json:"data"` Status string `json:"status"` }
Array of maps. Ref: #/components/schemas/Maps
func (*Maps) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Maps) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type MapsDataItem ¶
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) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Matrix) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type MatrixResult ¶
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 OptDirection ¶
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 ¶
func (o OptDirection) Or(d Direction) Direction
Or returns value if set, or given parameter if does not.
type OptInt ¶
OptInt is optional int.
type OptLabelSet ¶
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) UnmarshalJSON ¶
func (s *OptLabelSet) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptLokiTime ¶
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.
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 ¶
func (o OptPrometheusDuration) Get() (v PrometheusDuration, ok bool)
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 ¶
func (o OptPrometheusDuration) Or(d PrometheusDuration) PrometheusDuration
Or returns value if set, or given parameter if does not.
func (*OptPrometheusDuration) SetTo ¶
func (o *OptPrometheusDuration) SetTo(v PrometheusDuration)
SetTo sets value to v.
type OptString ¶
OptString is optional string.
func NewOptString ¶
NewOptString returns new OptString with value set to v.
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
func (PrometheusDuration) Validate ¶
func (s PrometheusDuration) Validate() error
type Push ¶
type Push struct {
Streams []Stream `json:"streams"`
}
Ref: #/components/schemas/Push
func (*Push) GetStreams ¶
GetStreams returns the value of Streams.
func (*Push) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Push) SetStreams ¶
SetStreams sets the value of Streams.
func (*Push) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
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 // The evaluation time for the query as a nanosecond Unix epoch or another supported format. // Defaults to now. Time OptLokiTime // Determines the sort order of logs. // Supported values are `forward` or `backward`. // Defaults to `backward`. Direction OptDirection }
QueryParams is parameters of query operation.
type QueryRangeParams ¶
type QueryRangeParams struct { Start OptLokiTime End OptLokiTime // 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 // 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 // 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 // Determines the sort order of logs. // Supported values are `forward` or `backward`. // Defaults to `backward`. Direction OptDirection }
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 Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
type Sample ¶ added in v0.0.8
type Sample struct { Metric OptLabelSet `json:"metric"` Value FPoint `json:"value"` }
Ref: #/components/schemas/Sample
func (*Sample) GetMetric ¶ added in v0.0.8
func (s *Sample) GetMetric() OptLabelSet
GetMetric returns the value of Metric.
func (*Sample) MarshalJSON ¶ added in v0.0.8
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) UnmarshalJSON ¶ added in v0.0.8
UnmarshalJSON implements stdjson.Unmarshaler.
type ScalarResult ¶
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) GetMetric ¶
func (s *Series) GetMetric() OptLabelSet
GetMetric returns the value of Metric.
func (*Series) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Series) SetMetric ¶
func (s *Series) SetMetric(val OptLabelSet)
SetMetric sets the value of Metric.
func (*Series) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type SeriesParams ¶
type SeriesParams struct { Start OptLokiTime End OptLokiTime // 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 Match []string }
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.
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) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Stats) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Stream ¶
type Stream struct { Stream OptLabelSet `json:"stream"` Values []LogEntry `json:"values"` }
Ref: #/components/schemas/Stream
func (*Stream) GetStream ¶
func (s *Stream) GetStream() OptLabelSet
GetStream returns the value of Stream.
func (*Stream) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Stream) SetStream ¶
func (s *Stream) SetStream(val OptLabelSet)
SetStream sets the value of Stream.
func (*Stream) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Streams ¶
type Streams []Stream
func (Streams) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Streams) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type StreamsResult ¶
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) 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) Push ¶
func (UnimplementedHandler) Push(ctx context.Context, req PushReq) error
Push implements push operation.
Push data.
POST /loki/api/v1/push
func (UnimplementedHandler) Query ¶
func (UnimplementedHandler) Query(ctx context.Context, params QueryParams) (r *QueryResponse, _ error)
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) 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 ¶
Array of strings. Ref: #/components/schemas/Values
func (*Values) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Values) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Vector ¶
type Vector []Sample
func (Vector) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Vector) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type VectorResult ¶
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
Source Files ¶
- oas_cfg_gen.go
- oas_client_gen.go
- oas_defaults_gen.go
- oas_handlers_gen.go
- oas_interfaces_gen.go
- oas_json_gen.go
- oas_labeler_gen.go
- oas_middleware_gen.go
- oas_parameters_gen.go
- oas_request_decoders_gen.go
- oas_request_encoders_gen.go
- oas_response_decoders_gen.go
- oas_response_encoders_gen.go
- oas_router_gen.go
- oas_schemas_gen.go
- oas_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go