tui

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const LogoColor = "#816FA6"

Variables

This section is empty.

Functions

func GetProgram

func GetProgram(ctx context.Context) *tea.Program

func NewLogCore

func NewLogCore(opts logging.LogOpts, verbosity Verbosity, program *tea.Program) zapcore.Core

func NewModel

func NewModel(verbosity Verbosity) *model
func RenderLogo() string

func WithProgram

func WithProgram(ctx context.Context, p *tea.Program) context.Context

func WithProgress

func WithProgress(ctx context.Context, progress Progress) context.Context

Types

type ErrorMessage added in v0.7.2

type ErrorMessage struct {
	Message string
}

type LogCore

type LogCore struct {
	zapcore.Core
	// contains filtered or unexported fields
}

func (*LogCore) Check

func (*LogCore) With

func (c *LogCore) With(f []zapcore.Field) zapcore.Core

func (*LogCore) Write

func (c *LogCore) Write(ent zapcore.Entry, fields []zapcore.Field) error

type LogMessage

type LogMessage struct {
	Construct string
	Message   string
}

type LogProgress

type LogProgress struct {
	Logger *zap.Logger
}

func (LogProgress) Complete

func (p LogProgress) Complete(status string)

func (LogProgress) Update

func (p LogProgress) Update(status string, current, total int)

func (LogProgress) UpdateIndeterminate

func (p LogProgress) UpdateIndeterminate(status string)

type OutputMessage

type OutputMessage struct {
	Construct string
	Name      string
	Value     any
}

type Progress

type Progress interface {
	// Update updates the progress status with the current and total count.
	Update(status string, current, total int)
	UpdateIndeterminate(status string)
	Complete(status string)
}

func GetProgress

func GetProgress(ctx context.Context) Progress

type RingBuffer

type RingBuffer[T any] struct {
	// contains filtered or unexported fields
}

func NewRingBuffer

func NewRingBuffer[T any](size int) *RingBuffer[T]

func (*RingBuffer[T]) Cap

func (r *RingBuffer[T]) Cap() int

func (*RingBuffer[T]) Clear

func (r *RingBuffer[T]) Clear()

func (*RingBuffer[T]) ForEach

func (r *RingBuffer[T]) ForEach(f func(int, T))

func (*RingBuffer[T]) Get

func (r *RingBuffer[T]) Get(i int) (T, bool)

func (*RingBuffer[T]) Len

func (r *RingBuffer[T]) Len() int

func (*RingBuffer[T]) Pop

func (r *RingBuffer[T]) Pop() T

func (*RingBuffer[T]) Push

func (r *RingBuffer[T]) Push(v T)

func (*RingBuffer[T]) Set

func (r *RingBuffer[T]) Set(i int, v T) bool

type TuiProgress

type TuiProgress struct {
	Prog      *tea.Program
	Construct string
}

func (*TuiProgress) Complete

func (p *TuiProgress) Complete(status string)

func (*TuiProgress) Update

func (p *TuiProgress) Update(status string, current, total int)

func (*TuiProgress) UpdateIndeterminate

func (p *TuiProgress) UpdateIndeterminate(status string)

type UpdateMessage

type UpdateMessage struct {
	Construct string
	Status    string

	Percent       float64
	Indeterminate bool
	Complete      bool
}

type Verbosity

type Verbosity int
var (
	VerbosityConcise   Verbosity = 0
	VerbosityVerbose   Verbosity = 1
	VerbosityDebug     Verbosity = 2
	VerbosityDebugMore Verbosity = 3
)

func (Verbosity) CombineLogs

func (v Verbosity) CombineLogs() bool

CombineLogs controls whether to show all logs commingled in the TUI. In other words, sorted by timestamp, not grouped by construct.

func (Verbosity) LogLevel

func (v Verbosity) LogLevel() zapcore.Level

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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