view

package
v0.5.48 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeyMap = KeyMap{
	Up: key.NewBinding(
		key.WithKeys("k", "up"),
		key.WithHelp("↑/k", "move up"),
	),
	Down: key.NewBinding(
		key.WithKeys("j", "down"),
		key.WithHelp("↓/j", "move down"),
	),
	Quit: key.NewBinding(
		key.WithKeys("q", "esc", "ctrl+c"),
		key.WithHelp("q", "quit"),
	),
	Filter: key.NewBinding(
		key.WithKeys("f"),
		key.WithHelp("f", "filter logs"),
	),
	Level: key.NewBinding(
		key.WithKeys("l"),
		key.WithHelp("l", "log level"),
	),
}

Functions

This section is empty.

Types

type ErrMsg

type ErrMsg error

type KeyMap

type KeyMap struct {
	Up     key.Binding
	Down   key.Binding
	Quit   key.Binding
	Filter key.Binding
	Level  key.Binding
}

type LogMsg

type LogMsg string

LogMsg sends data to the log panel

type LogView

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

func NewLogView

func NewLogView() (*LogView, error)

func (*LogView) Display

func (c *LogView) Display() error

Display starts the view, this is a blocking function

func (*LogView) Logger

func (c *LogView) Logger() logger.Logger

Logger returns the logger used by the view

func (*LogView) UpdateStatus

func (c *LogView) UpdateStatus(message string, withTimer bool)

UpdateStatus shows the current status message, if withTimer is set the elapsed time that the the status has been shown for will also be displayed

type StatusModel

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

func NewStatus

func NewStatus() StatusModel

func (StatusModel) Init

func (m StatusModel) Init() tea.Cmd

func (StatusModel) Update

func (m StatusModel) Update(msg tea.Msg) (StatusModel, tea.Cmd)

func (StatusModel) View

func (m StatusModel) View() string

type StatusMsg

type StatusMsg struct {
	Message     string
	ShowElapsed bool
}

StatusMsg updates the status bar, optionally the elapsed time and spinner can be enabled

type TTYView

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

func NewTTYView

func NewTTYView() (*TTYView, error)

func (*TTYView) Display

func (c *TTYView) Display() error

Display starts the view, this is a blocking function

func (*TTYView) Logger

func (c *TTYView) Logger() logger.Logger

Logger returns the logger used by the view

func (*TTYView) UpdateStatus

func (c *TTYView) UpdateStatus(message string, withTimer bool)

UpdateStatus shows the current status message, if withTimer is set the elapsed time that the the status has been shown for will also be displayed

type TickMsg

type TickMsg time.Time

type View

type View interface {

	// Display starts the view, this is a blocking function
	Display() error

	// Logger returns the logger used by the view
	Logger() logger.Logger

	// UpdateStatus shows the current status message, if withTimer is set
	// the elapsed time that the the status has been shown for will also
	// be displayed
	UpdateStatus(message string, withTimer bool)
}

Jump to

Keyboard shortcuts

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