Documentation ¶
Index ¶
- func FormatTS(ts time.Time) string
- type Client
- func (c *Client) AddDeleteRequest(params DeleteRequestParams) error
- func (c *Client) Flush() error
- func (c *Client) Get(path string) (*http.Response, error)
- func (c *Client) GetDeleteRequests() (DeleteRequests, error)
- func (c *Client) GetRules(ctx context.Context) (*RulesResponse, error)
- func (c *Client) LabelNames(ctx context.Context) ([]string, error)
- func (c *Client) LabelValues(ctx context.Context, labelName string) ([]string, error)
- func (c *Client) Metrics() (string, error)
- func (c *Client) PushLogLine(line string, timestamp time.Time, structuredMetadata map[string]string, ...) error
- func (c *Client) PushOTLPLogLine(line string, timestamp time.Time, logAttributes map[string]any) error
- func (c *Client) RunQuery(ctx context.Context, query string, extraHeaders ...Header) (*Response, error)
- func (c *Client) RunRangeQuery(ctx context.Context, query string, extraHeaders ...Header) (*Response, error)
- func (c *Client) RunRangeQueryWithStartEnd(ctx context.Context, query string, start, end time.Time, ...) (*Response, error)
- func (c *Client) Series(ctx context.Context, matcher string) ([]map[string]string, error)
- func (c *Client) Stats(ctx context.Context, query string) ([]map[string]int, error)
- func (c *Client) Tail(ctx context.Context, query string, out chan TailResult) (*websocket.Conn, error)
- type DataType
- type DeleteRequest
- type DeleteRequestParams
- type DeleteRequests
- type Entry
- type Header
- type InjectHeadersOption
- type MatrixValues
- type Option
- type Response
- type Rules
- type RulesData
- type RulesResponse
- type StreamValues
- type TailResult
- type VectorValues
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
Client is a HTTP client that adds basic auth and scope
func (*Client) AddDeleteRequest ¶
func (c *Client) AddDeleteRequest(params DeleteRequestParams) error
AddDeleteRequest adds a new delete request
func (*Client) GetDeleteRequests ¶
func (c *Client) GetDeleteRequests() (DeleteRequests, error)
GetDeleteRequests returns all delete requests
func (*Client) GetRules ¶
func (c *Client) GetRules(ctx context.Context) (*RulesResponse, error)
GetRules returns the loki ruler rules
func (*Client) LabelValues ¶
LabelValues return a LabelValues query result
func (*Client) PushLogLine ¶
func (*Client) PushOTLPLogLine ¶
func (*Client) RunQuery ¶
func (c *Client) RunQuery(ctx context.Context, query string, extraHeaders ...Header) (*Response, error)
RunQuery runs a query and returns an error if anything went wrong
func (*Client) RunRangeQuery ¶
func (c *Client) RunRangeQuery(ctx context.Context, query string, extraHeaders ...Header) (*Response, error)
RunRangeQuery runs a 7d query and returns an error if anything went wrong This function is kept to keep backwards copatibility of existing tests. Better use (*Client).RunRangeQueryWithStartEnd()
func (*Client) RunRangeQueryWithStartEnd ¶
func (c *Client) RunRangeQueryWithStartEnd(ctx context.Context, query string, start, end time.Time, extraHeaders ...Header) (*Response, error)
RunRangeQuery runs a query and returns an error if anything went wrong
type DataType ¶
type DataType struct { ResultType string Stream []StreamValues Matrix []MatrixValues Vector []VectorValues EncodingFlags []string }
DataType holds the result type and a list of StreamValues
func (*DataType) UnmarshalJSON ¶
type DeleteRequest ¶
type DeleteRequestParams ¶
type DeleteRequests ¶
type DeleteRequests []DeleteRequest
type InjectHeadersOption ¶
func (InjectHeadersOption) Type ¶
func (n InjectHeadersOption) Type() string
type MatrixValues ¶
MatrixValues holds a label key value pairs for the metric and a list of a list of values
type RulesResponse ¶
type StreamValues ¶
StreamValues holds a label key value pairs for the Stream and a list of a list of values
type TailResult ¶
type TailResult struct { Response loghttp.TailResponse Err error }
type VectorValues ¶
VectorValues holds a label key value pairs for the metric and single timestamp and value
func (*VectorValues) UnmarshalJSON ¶
func (a *VectorValues) UnmarshalJSON(b []byte) error