Documentation ¶
Index ¶
- func Mode(m string) string
- func NewFake(t *testing.T, expectedTime time.Time, expectedLines ...string) *fake
- func NewStdOut(mode string, noLabels bool, labels ...string) (output.LogOutput, error)
- func StdOut(mode string) (output.LogOutput, error)
- type Client
- func (c *Client) LiveTailQueryConn(ctx context.Context, queryStr string, delayFor time.Duration, limit int, ...) (*websocket.Conn, error)
- func (c *Client) QueryRange(ctx context.Context, out output.LogOutput, q Query) error
- func (c *Client) QueryRangeResponse(ctx context.Context, q Query) (*loghttp.QueryResponse, error)
- func (c *Client) QueryRangeWithRetry(ctx context.Context, out output.LogOutput, q Query) error
- func (c *Client) TailQuery(ctx context.Context, delayFor time.Duration, out output.LogOutput, q Query) error
- type Query
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { logclient.Client StdOut output.LogOutput // contains filtered or unexported fields }
func (*Client) LiveTailQueryConn ¶ added in v1.7.6
func (c *Client) LiveTailQueryConn(ctx context.Context, queryStr string, delayFor time.Duration, limit int, start time.Time, quiet bool) (*websocket.Conn, error)
LiveTailQueryConn does a live tailing with a specific query.
func (*Client) QueryRange ¶
QueryRange queries logs within a specific time range and prints the result.
func (*Client) QueryRangeResponse ¶ added in v1.7.6
QueryRangeResponse queries logs within a specific time range and returns the response.
func (*Client) QueryRangeWithRetry ¶ added in v1.2.6
QueryRangeWithRetry queries logs within a specific time range with a retry in case of an error or not finding any logs.
func (*Client) TailQuery ¶
func (c *Client) TailQuery(ctx context.Context, delayFor time.Duration, out output.LogOutput, q Query) error
TailQuery tails logs using the loki websocket endpoint. This has been adapted from https://github.com/grafana/loki/blob/v2.8.2/pkg/logcli/query/tail.go#L22 as it directly prints out messages using builtin log, which we don't want.
Click to show internal directories.
Click to hide internal directories.