Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogMsg ¶
LogMsg is equivalent to LogMsgCtx, using the context.Background() as context. See LogMsgCtx.
func LogMsgCtx ¶
func LogMsgCtx(ctx context.Context, l *slog.Logger, level slog.Level, text string, label string, msg tea.Msg, args ...any)
LogMsgCtx is a helper function that logs a tea.Msg to a slog.Logger. It logs the key type and value. If the message supports the fmt.Stringer interface, it is used to format the key value. Otherwise, the value is formatted using fmt's "%#v" printing verb.
Types ¶
type KeyMap ¶
KeyMap represents the key bindings for a Stream.
func DefaultKeyMap ¶
func DefaultKeyMap() KeyMap
DefaultKeyMap returns the default key map for a Stream.
type Option ¶
type Option func(*Stream)
Option is a functional option for configuring a Stream.
func WithAutoScroll ¶
WithAutoScroll overrides the initial state of auto-scrolling.
func WithMaxSize ¶
WithMaxSize sets the maximum number of bytes that are kept in memory.
func WithShowToggles ¶
WithShowToggles switches showing the state of the word wrap and auto-scrolling toggles.
func WithWrapLines ¶
WithWrapLines overrides the initial state of word wrapping.
type SetSizeMsg ¶
SetSizeMsg sets the size of the Stream contents
type Stream ¶
A Stream is a model that implements io.Writer. Applications can write data to the stream and it will be displayed in a viewport.
This model was written to display an application's slog output, but it can be used for any kind of streaming data.