viewport

package
v0.0.0-...-4a49f3e Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Black        = "0"
	Red          = "1"
	Green        = "2"
	Orange       = "3"
	Blue         = "4"
	Purple       = "5"
	Cyan         = "6"
	Gray         = "7" // Should be lighter than 8
	BrightBlack  = "8" // Darker than 7
	BrightRed    = "9"
	BrightGreen  = "10"
	BrightOrange = "11"
	BrightBlue   = "12"
	BrightPurple = "13"
	BrightCyan   = "14"
	BrightGray   = "15"
)
View Source
const (
	FILTER fieldStatus = 0
	SEARCH fieldStatus = 1
)

Variables

This section is empty.

Functions

func NewModel

func NewModel(
	command string,
	mediator mediator.Mediator,
) model

Types

type AppendContentMsg

type AppendContentMsg struct {
	Content string
}

Append lines to the current content

type ClearContentMsg

type ClearContentMsg struct{}

Clear the whole content

type KeyMap

type KeyMap struct {
	Blur          key.Binding
	Search        key.Binding
	Filter        key.Binding
	Accept        key.Binding
	NextMatch     key.Binding
	PreviousMatch key.Binding
	Quit          key.Binding
	HalfPageUp    key.Binding
	HalfPageDown  key.Binding
	Restart       key.Binding
	ShowHelp      key.Binding
}

func DefaultKeyBinding

func DefaultKeyBinding() KeyMap

type Program

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

func NewProgram

func NewProgram(command string, mediator mediator.Mediator) *Program

func (*Program) Append

func (p *Program) Append(content string)

func (*Program) OnError

func (p *Program) OnError(err error)

func (*Program) OnKill

func (p *Program) OnKill()

func (*Program) OnOutput

func (p *Program) OnOutput(output string)

func (*Program) OnRequestRestart

func (p *Program) OnRequestRestart()

func (*Program) OnStart

func (p *Program) OnStart(command string)

func (*Program) OnStop

func (p *Program) OnStop()

func (*Program) Run

func (p *Program) Run()

type SetContentMsg

type SetContentMsg struct {
	Content string
}

Set the whole content at once

Jump to

Keyboard shortcuts

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