tconsole

package
v0.0.0-...-5fb8a3f Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

type Console struct {
	Quit chan struct{}
	// contains filtered or unexported fields
}

Console is a Terminal Console (TConsole), a user-interactive informational display visible on the TTY of a running Metropolis instance.

func New

func New(terminal Terminal, ttyPath string, lt *logtree.LogTree, network event.Value[*network.Status], roles event.Value[*cpb.NodeRoles], curatorConn event.Value[*roleserve.CuratorConnection]) (*Console, error)

New creates a new Console, taking over the TTY at the given path. The given Terminal type selects between a Linux terminal (VTY) and a generic terminal for testing.

network, roles, curatorConn point to various Metropolis subsystems that are used to populate the console data.

func (*Console) Cleanup

func (c *Console) Cleanup()

Cleanup should be called when the console exits. This is only used in testing, the Metropolis console always runs.

func (*Console) Run

func (c *Console) Run(ctx context.Context) error

Run blocks while displaying the Console to the user.

type Terminal

type Terminal string

Terminal is a supported terminal kind. This is a simplistic alternative to terminfo.

const (
	// TerminalLinux is a linux VTY console.
	TerminalLinux Terminal = "linux"
	// TerminalGeneric is any other terminal that is supported by tcell.
	TerminalGeneric Terminal = "generic"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳