app

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 40 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const RejoinCommand = "server.rejoin"

Command that moves the terminal to the server of its profile once that server answers again

Variables

This section is empty.

Functions

func Drawn

func Drawn(dir string) map[string]Graphics

What each terminal of this computer was last found to draw, by the name its record is kept under, as the settings folder keeps it; none where no terminal told it or the file does not read

func On

func On(value string) bool

Whether a value as YAML that Used read is on: a toggle, or text that reads as one, as the server reads a toggle whose text names a variable whose value is that text

func Shown

func Shown(value string) bool

Whether a value as YAML that the settings service shows of a setting is not the value in use: text that names a variable as ${NAME}, which it shows as it is written, or a secret it masks. A change told with such a value is read again with Used

func Used

func Used(ctx context.Context, settings configv1connect.ConfigServiceClient, key, profile string) (string, error)

Value as YAML of the setting under the key as it is read for use, every reference in its text standing for the variable it names: JSON, which reads as YAML, and null for a key that holds nothing. What the app and its screens act on, where the settings service shows the value as it is written. The profile is the window's for none

Types

type App

type App struct {
	Registry
	// contains filtered or unexported fields
}

func New

func New(cfg *config.Config) *App

func (*App) Answers

func (a *App) Answers()

Says the server the terminal fell back from answers again, which the bar then offers to move to

func (*App) Connecting

func (a *App) Connecting(connecting func(profile string) bool)

Sets how to tell whether switching to a profile needs a connection to another server

func (*App) Console

func (a *App) Console() func()

Switches nothing: the terminals of the other systems take UTF-8 text as they are

func (*App) FellBack

func (a *App) FellBack(address string, move func(shown []tui.Shown) error)

Says the terminal runs on its own server because the server of its profile at the address did not answer, and how to move there once it does; an empty address says it runs where its profile says

func (*App) Getenv

func (a *App) Getenv(profile, name string) string

Environment variable for work this terminal does itself, such as a sign-in's proxy: the profile's value (the window's profile for an empty name) on this terminal's own server, this computer's own value on another computer's server

func (*App) Reconnect

func (a *App) Reconnect(profile string)

Ends the running app so the terminal connects again for the profile, keeping its layout; does nothing when the app is not running

func (*App) Refusing

func (a *App) Refusing(refusing func(profile, backend, then string) string)

Sets why the window can't move to the server a profile uses, which every screen that would move it asks first

func (*App) RequestWait

func (a *App) RequestWait() time.Duration

How long the window waits for its server to answer a request, as Answer wait says; none for no limit

func (*App) Run

func (a *App) Run(ctx context.Context, conn *connect.Client) (err error)

Runs the screens until the person quits, then closes the registrants. It returns a *Reconnect when the terminal must move to another server

func (*App) Say

func (a *App) Say(text string)

Shows a line in the terminal now, or as soon as the app opens

func (*App) Server

func (a *App) Server(address, profile string)

Sets the server the terminal uses (empty for its own) and, on the first call, the start profile its layout is saved under

func (*App) Shed

func (a *App) Shed(all bool)

Has every card of the window let go of what it drew and keeps to draw again, what it drew for another size or with all everything, as the memory of the process nears what it may use; nothing before the window runs

func (*App) Speak

func (a *App) Speak(id string)

Has the window's requests answered in the language of the id from their next one on

func (*App) StartupWait

func (a *App) StartupWait() time.Duration

How long the window waits for the server it is set to use as it opens, as Server wait says

func (*App) Unanswered

func (a *App) Unanswered(timed *calls.TimedOut) bool

Asks the person whether a call its server did not answer in time goes again: a warning names the call, the wait and the key that asks again, and the call is given up when the key is not pressed while the warning stands, or the window closes. A call made before the window runs, or with no window at all, is given up at once

func (*App) Unsaid

func (a *App) Unsaid() []string

Takes the lines not shown yet, for a terminal that runs a command instead of the app

func (*App) Window

func (a *App) Window(w *client.Window)

Has the window's requests follow the profile the window runs on as /profiles switches it, and wait for their answers as Answer wait says, the person asked whether one the server did not answer in time goes again

type Graphics

type Graphics struct {
	gfx.Report
	At time.Time `json:"at"`
}

What a terminal was found to draw as a window of it last told, and when

func (Graphics) Key

func (g Graphics) Key() string

Name a terminal's record is kept under: its name, and what stands between it and icebath, which changes what it draws

type Parter

type Parter interface {
	// Lines to print below the app in the terminal, none for nothing to say; own is whether the server the window ran on was this process's
	// own, which ends with it. Honour ctx, which ends at the wait
	Parting(ctx context.Context, own bool) []string
}

Registrant with something to say once the window is gone, such as how to come back to the sessions written to and the work left running

type Reconnect

type Reconnect struct {
	Profile string
}

Error a run ends with when the terminal must connect to the server of another profile

func (*Reconnect) Error

func (r *Reconnect) Error() string

type Refused

type Refused struct {
	Action string
	Chords []string
	Why    string
}

A saved shortcut the keys of this app refuse, and why in a sentence a person reads

func Shortcuts

func Shortcuts(cfg *config.Config) (*keys.Map, []Refused, int, error)

The keys of this app as the settings leave them: the kit's actions at their default keys with the saved shortcuts over them, the saved shortcuts the keys refuse, and how many saved ones differ from their defaults. A saved shortcut of an action only a screen brings is not judged here, as the screens are the window's; one that can't be read at all is the error

type Registrant

type Registrant interface {
	Screens(conn *connect.Client) []tui.Screen
}

type Registry

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

func (*Registry) Close

func (r *Registry) Close() error

Lets every registrant that holds something past the screens, such as a microphone, let go of it as the app exits, the last registered first

func (*Registry) Parting

func (r *Registry) Parting(ctx context.Context, own bool) []string

What the registrants that part say, in the order they were registered, a blank line between two of them

func (*Registry) Register

func (r *Registry) Register(registrant Registrant)

func (*Registry) Screens

func (r *Registry) Screens(conn *connect.Client) []tui.Screen

func (*Registry) Steps

func (r *Registry) Steps(kit *tui.Kit) []firstrun.Step

Steps of the first run every registrant offers of the window's own computer, in the order they registered; called off the UI loop

type Stepper

type Stepper interface {
	// The steps, each with what was found of it on this computer; called off the UI loop
	Steps(kit *tui.Kit) []firstrun.Step
}

A registrant that also offers steps of the first run about the computer the window runs on, which the window alone can look at, such as the keys the terminal it runs in sends

Directories

Path Synopsis
Package known reads the sets a form's list field picks items from.
Package known reads the sets a form's list field picks items from.
Package server serves what the terminal app reads of the server beside the settings, such as the styles a profile keeps
Package server serves what the terminal app reads of the server beside the settings, such as the styles a profile keeps

Jump to

Keyboard shortcuts

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