Documentation
¶
Overview ¶
Package commands provides tea.Cmd factories for async operations.
Index ¶
- Constants
- func ClearStatusAfter(d time.Duration, gen int) tea.Cmd
- func CopyToClipboard(text string) tea.Cmd
- func Follow(ctx context.Context, c *loki.Client, query string, since time.Duration, ...) <-chan loki.FollowEvent
- func LoadBuildInfo(ctx context.Context, c *loki.Client) tea.Cmd
- func LoadLabels(ctx context.Context, c *loki.Client, since time.Duration) tea.Cmd
- func LoadOlder(ctx context.Context, c *loki.Client, query string, end time.Time, ...) tea.Cmd
- func LoadValues(ctx context.Context, c *loki.Client, label, scope string, since time.Duration, ...) tea.Cmd
- func ScheduleClock(gen uint64) tea.Cmd
- func ScheduleValues(gen uint64) tea.Cmd
- func WaitTail(events <-chan loki.FollowEvent, gen uint64) tea.Cmd
Constants ¶
const OlderLimit = 500
OlderLimit is the number of entries one load of older entries reads.
const ValuesDelay = 150 * time.Millisecond
ValuesDelay is how long the cursor rests on a label before its values are loaded, so moving through the labels does not ask for the values of every one passed.
Variables ¶
This section is empty.
Functions ¶
func CopyToClipboard ¶
CopyToClipboard copies text using the system clipboard. On failure the update loop falls back to OSC52, which also works over ssh.
func Follow ¶
func Follow(ctx context.Context, c *loki.Client, query string, since time.Duration, limit int) <-chan loki.FollowEvent
Follow starts tailing query in the background, beginning with up to limit entries of the last since. The tail runs until ctx is done; WaitTail reads what it reports.
func LoadLabels ¶
LoadLabels lists the label names seen in the last since.
func LoadOlder ¶
func LoadOlder(ctx context.Context, c *loki.Client, query string, end time.Time, since time.Duration, gen uint64) tea.Cmd
LoadOlder reads the newest OlderLimit entries of query in the window of since before end.
func LoadValues ¶
func LoadValues(ctx context.Context, c *loki.Client, label, scope string, since time.Duration, volumes bool) tea.Cmd
LoadValues lists the values of label seen in the last since, of the streams scope selects or of all of them when it is empty, with their volumes unless volumes is off.
func ScheduleClock ¶
ScheduleClock ticks once a second while a tail runs.
func ScheduleValues ¶
ScheduleValues asks for the values of the label under the cursor after ValuesDelay.
Types ¶
This section is empty.