model

package
v0.1.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ResultTypeStream = "streams"
	ResultTypeScalar = "scalar"
	ResultTypeVector = "vector"
	ResultTypeMatrix = "matrix"
)

ResultType values

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatedQueryResponse added in v0.1.3

type AggregatedQueryResponse struct {
	ResultType    ResultType      `json:"resultType"`
	Result        ResultValue     `json:"result"`
	Stats         AggregatedStats `json:"stats"`
	IsMock        bool            `json:"isMock"`
	UnixTimestamp int64           `json:"unixTimestamp"`
}

AggregatedQueryResponse represents the modified json response to one or more logQL queries

func (*AggregatedQueryResponse) UnmarshalJSON added in v0.1.3

func (q *AggregatedQueryResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type AggregatedStats added in v0.1.3

type AggregatedStats struct {
	NumQueries   int           `json:"numQueries"`
	TotalEntries int           `json:"totalEntries"`
	Duplicates   int           `json:"duplicates"`
	LimitReached bool          `json:"limitReached"`
	QueriesStats []interface{} `json:"queriesStats"`
}

AggregatedStats represents the stats to one or more logQL queries

type Entry added in v0.1.1

type Entry struct {
	Timestamp time.Time
	Line      string
}

Entry represents a log entry. It includes a log message and the time it occurred at.

func (*Entry) MarshalJSON added in v0.1.1

func (e *Entry) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*Entry) UnmarshalJSON added in v0.1.1

func (e *Entry) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type LabelValuesResponse added in v0.1.2

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

LabelValuesResponse represents the http json response to a query for label values

type Matrix added in v0.1.1

type Matrix []model.SampleStream

Matrix is a slice of SampleStreams

func (Matrix) Type added in v0.1.1

func (Matrix) Type() ResultType

Type implements the promql.Value interface

type QueryResponse added in v0.1.1

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

QueryResponse represents the http json response to a logQL query

type QueryResponseData added in v0.1.1

type QueryResponseData struct {
	ResultType ResultType  `json:"resultType"`
	Result     ResultValue `json:"result"`
	Stats      interface{} `json:"-"`
}

QueryResponseData represents the http json response to a label query

func (*QueryResponseData) UnmarshalJSON added in v0.1.1

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

UnmarshalJSON implements the json.Unmarshaler interface.

type ResultType added in v0.1.1

type ResultType string

ResultType holds the type of the result

type ResultValue added in v0.1.1

type ResultValue interface {
	Type() ResultType
}

ResultValue interface mimics the promql.Value interface

type Scalar added in v0.1.1

type Scalar model.Scalar

Scalar is a single timestamp/float with no labels

func (Scalar) MarshalJSON added in v0.1.1

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

func (Scalar) Type added in v0.1.1

func (Scalar) Type() ResultType

Type implements the promql.Value interface

func (*Scalar) UnmarshalJSON added in v0.1.1

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

type Stream added in v0.1.1

type Stream struct {
	Labels  map[string]string `json:"stream"`
	Entries []Entry           `json:"values"`
}

Stream represents a log stream. It includes a set of log entries and their labels.

type Streams added in v0.1.1

type Streams []Stream

Streams is a slice of Stream

func (Streams) Type added in v0.1.1

func (Streams) Type() ResultType

Type implements the promql.Value interface

type Vector added in v0.1.1

type Vector []model.Sample

Vector is a slice of Samples

func (Vector) Type added in v0.1.1

func (Vector) Type() ResultType

Type implements the promql.Value interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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