Documentation
¶
Overview ¶
Package marshal converts internal objects to loghttp model objects. This package is designed to work with models in pkg/loghttp.
Index ¶
- func NewDroppedStream(s *legacy.DroppedEntry) (loghttp.DroppedStream, error)
- func NewEntry(e logproto.Entry) loghttp.Entry
- func NewLabelSet(s string) (loghttp.LabelSet, error)
- func NewMatrix(m promql.Matrix) loghttp.Matrix
- func NewMetric(l labels.Labels) model.Metric
- func NewResultValue(v parser.Value) (loghttp.ResultValue, error)
- func NewSample(s promql.Sample) model.Sample
- func NewSampleStream(s promql.Series) model.SampleStream
- func NewScalar(s promql.Scalar) loghttp.Scalar
- func NewStream(s logproto.Stream) (loghttp.Stream, error)
- func NewStreams(s logql.Streams) (loghttp.Streams, error)
- func NewTailResponse(r legacy.TailResponse) (loghttp.TailResponse, error)
- func NewVector(v promql.Vector) loghttp.Vector
- func WriteLabelResponseJSON(l logproto.LabelResponse, w io.Writer) error
- func WriteQueryResponseJSON(v logql.Result, w io.Writer) error
- func WriteSeriesResponseJSON(r logproto.SeriesResponse, w io.Writer) error
- func WriteTailResponseJSON(r legacy.TailResponse, c *websocket.Conn) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDroppedStream ¶
func NewDroppedStream(s *legacy.DroppedEntry) (loghttp.DroppedStream, error)
NewDroppedStream constructs a DroppedStream from a legacy.DroppedEntry
func NewEntry ¶
func NewEntry(e logproto.Entry) loghttp.Entry
NewEntry constructs an Entry from a logproto.Entry
func NewLabelSet ¶
func NewLabelSet(s string) (loghttp.LabelSet, error)
NewLabelSet constructs a Labelset from a promql metric list as a string
func NewMatrix ¶
func NewMatrix(m promql.Matrix) loghttp.Matrix
NewMatrix constructs a Matrix from a promql.Matrix
func NewMetric ¶
func NewMetric(l labels.Labels) model.Metric
NewMetric constructs a labels.Labels from a model.Metric
func NewResultValue ¶
func NewResultValue(v parser.Value) (loghttp.ResultValue, error)
NewResultValue constructs a ResultValue from a promql.Value
func NewSample ¶
func NewSample(s promql.Sample) model.Sample
NewSample constructs a model.Sample from a promql.Sample
func NewSampleStream ¶
func NewSampleStream(s promql.Series) model.SampleStream
NewSampleStream constructs a model.SampleStream from a promql.Series
func NewStream ¶
func NewStream(s logproto.Stream) (loghttp.Stream, error)
NewStream constructs a Stream from a logproto.Stream
func NewStreams ¶
func NewStreams(s logql.Streams) (loghttp.Streams, error)
NewStreams constructs a Streams from a logql.Streams
func NewTailResponse ¶
func NewTailResponse(r legacy.TailResponse) (loghttp.TailResponse, error)
NewTailResponse constructs a TailResponse from a legacy.TailResponse
func NewVector ¶
func NewVector(v promql.Vector) loghttp.Vector
NewVector constructs a Vector from a promql.Vector
func WriteLabelResponseJSON ¶
func WriteLabelResponseJSON(l logproto.LabelResponse, w io.Writer) error
WriteLabelResponseJSON marshals a logproto.LabelResponse to v1 loghttp JSON and then writes it to the provided io.Writer.
func WriteQueryResponseJSON ¶
func WriteQueryResponseJSON(v logql.Result, w io.Writer) error
WriteQueryResponseJSON marshals the promql.Value to v1 loghttp JSON and then writes it to the provided io.Writer.
func WriteSeriesResponseJSON ¶ added in v1.3.0
func WriteSeriesResponseJSON(r logproto.SeriesResponse, w io.Writer) error
WriteSeriesResponseJSON marshals a logproto.SeriesResponse to v1 loghttp JSON and then writes it to the provided io.Writer.
func WriteTailResponseJSON ¶
func WriteTailResponseJSON(r legacy.TailResponse, c *websocket.Conn) error
WriteTailResponseJSON marshals the legacy.TailResponse to v1 loghttp JSON and then writes it to the provided connection.
Types ¶
This section is empty.