ui

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureStdoutToTraceLog

func CaptureStdoutToTraceLog() (close func())

CaptureStdoutToTraceLog replaces stdout and redirects output to the log as trace lines. The return value is a function, which is used to stop the current capturing of output and restore the original file. Example:

restore := CaptureStdoutToTraceLog()
// here, stdout will be captured and redirected to the provided writer
restore() // block until the output has all been sent to the writer and restore the original stdout

Types

type NoUI

type NoUI struct {
	// contains filtered or unexported fields
}

func None

func None(out io.Writer, quiet bool) *NoUI

func (*NoUI) Handle

func (n *NoUI) Handle(e partybus.Event) error

func (*NoUI) Setup

func (n *NoUI) Setup(subscription partybus.Unsubscribable) error

func (NoUI) Teardown

func (n NoUI) Teardown(_ bool) error

type UI

type UI struct {
	// contains filtered or unexported fields
}

func New

func New(out io.Writer, quiet bool, handlers ...bubbly.EventHandler) *UI

func (*UI) Handle

func (m *UI) Handle(e partybus.Event) error

func (UI) Init

func (m UI) Init() tea.Cmd

func (UI) RespondsTo

func (m UI) RespondsTo() []partybus.EventType

func (*UI) Setup

func (m *UI) Setup(subscription partybus.Unsubscribable) error

func (*UI) Teardown

func (m *UI) Teardown(force bool) error

func (*UI) Update

func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (UI) View

func (m UI) View() string

Jump to

Keyboard shortcuts

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