commands

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package commands provides tea.Cmd factories for async operations.

Index

Constants

View Source
const OlderLimit = 500

OlderLimit is the number of entries one load of older entries reads.

View Source
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 ClearStatusAfter

func ClearStatusAfter(d time.Duration, gen int) tea.Cmd

func CopyToClipboard

func CopyToClipboard(text string) tea.Cmd

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 LoadBuildInfo

func LoadBuildInfo(ctx context.Context, c *loki.Client) tea.Cmd

func LoadLabels

func LoadLabels(ctx context.Context, c *loki.Client, since time.Duration) tea.Cmd

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

func ScheduleClock(gen uint64) tea.Cmd

ScheduleClock ticks once a second while a tail runs.

func ScheduleValues

func ScheduleValues(gen uint64) tea.Cmd

ScheduleValues asks for the values of the label under the cursor after ValuesDelay.

func WaitTail

func WaitTail(events <-chan loki.FollowEvent, gen uint64) tea.Cmd

WaitTail waits for the next follow event, and takes the ones already waiting behind it along, so a busy tail is drawn once per batch rather than once per message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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