Documentation
¶
Index ¶
- func Attach(sockPath string, name string, create bool, pfxKey byte) error
- func AuthAdd(key string) error
- func AuthList() error
- func AuthRemove(match string) error
- func EnableSSH(sockPath, addr string) error
- func EnableWeb(sockPath, addr string) error
- func Kill(sockPath string, name string) error
- func List(sockPath string) error
- func OnResize(fn func(cols, rows uint16)) func()
- func ReadScreen(sockPath, session string) (string, error)
- func RelayAdd(configPath string) error
- func RelayCancel(configPath string) error
- func RelayChangeEmail(configPath string) error
- func RelayDeleteAccount(configPath string) error
- func RelayDisable(configPath string) error
- func RelayEnable(configPath string) error
- func RelayKeys(configPath string) error
- func RelayRegister(configPath string) error
- func RelayRevoke(configPath string) error
- func RelayRotateKey(configPath string) error
- func RelaySSHConfig(configPath string) error
- func RelaySessions(configPath string) error
- func RelayStatus(configPath string) error
- func SendInput(sockPath, session, text string) error
- func ShellsCreate(cfgPath string) error
- func ShellsDestroy(cfgPath, nameOrID string) error
- func ShellsExec(cfgPath, nameOrID, command string) error
- func ShellsKeyAdd(cfgPath, nameOrID, keyFile string) error
- func ShellsKeyList(cfgPath, nameOrID string) error
- func ShellsList(cfgPath string) error
- func ShellsRestart(cfgPath, nameOrID string) error
- func ShellsSSH(cfgPath, nameOrID string) error
- func ShellsScreen(cfgPath, nameOrID string) error
- func ShellsSend(cfgPath, nameOrID, text string) error
- type RawTerminal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Attach ¶
Attach connects to the server, sends an attach or new-session command, and pipes the terminal with prefix key interception. pfxKey is the prefix key byte (0 = default Ctrl-]).
func AuthAdd ¶ added in v1.0.1
AuthAdd adds a public key to ~/.latch/authorized_keys. key can be a path to a file or an inline key string.
func AuthList ¶ added in v1.0.1
func AuthList() error
AuthList prints the keys in ~/.latch/authorized_keys.
func AuthRemove ¶ added in v1.0.1
AuthRemove removes a key from ~/.latch/authorized_keys by fingerprint or comment.
func OnResize ¶
func OnResize(fn func(cols, rows uint16)) func()
OnResize calls fn on terminal resize. Returns a stop function.
func ReadScreen ¶ added in v1.0.29
ReadScreen returns the plain text content of a session's screen.
func RelayAdd ¶
RelayAdd adds this device to an existing relay account. Sends an approval email — the user clicks the link, and the CLI detects it automatically.
func RelayCancel ¶ added in v1.0.1
RelayCancel cancels the relay subscription.
func RelayChangeEmail ¶ added in v1.0.1
RelayChangeEmail changes the email on the relay account.
func RelayDeleteAccount ¶ added in v1.0.1
RelayDeleteAccount permanently deletes the relay account.
func RelayDisable ¶
RelayDisable sets relay-enabled = false in the config file.
func RelayEnable ¶
RelayEnable sets relay-enabled = true in the config file.
func RelayRegister ¶
RelayRegister creates a new relay account: generates a key, calls the API, and the server emails the payment link.
func RelayRevoke ¶
RelayRevoke revokes a device's key from the account.
func RelayRotateKey ¶
RelayRotateKey generates a new relay key and rotates it via the API.
func RelaySSHConfig ¶
RelaySSHConfig prints an SSH config snippet for connecting through the relay.
func RelaySessions ¶
RelaySessions lists currently connected devices.
func RelayStatus ¶
RelayStatus prints the current relay configuration.
func ShellsCreate ¶ added in v1.0.13
ShellsCreate creates a new shell.
func ShellsDestroy ¶ added in v1.0.13
ShellsDestroy initiates shell destruction (sends verification email).
func ShellsExec ¶ added in v1.0.29
ShellsExec runs a command on a shell via the server API.
func ShellsKeyAdd ¶ added in v1.0.13
ShellsKeyAdd adds an SSH key to a shell (sends verification email).
func ShellsKeyList ¶ added in v1.0.13
ShellsKeyList lists SSH keys on a shell.
func ShellsList ¶ added in v1.0.13
ShellsList lists the user's shells.
func ShellsRestart ¶ added in v1.0.13
ShellsRestart initiates shell restart (sends verification email).
func ShellsScreen ¶ added in v1.0.29
ShellsScreen reads the terminal screen from a shell via the server API.
func ShellsSend ¶ added in v1.0.29
ShellsSend injects text into a session on a shell via the server API.
Types ¶
type RawTerminal ¶
type RawTerminal struct {
// contains filtered or unexported fields
}
func EnterRawMode ¶
func EnterRawMode() (*RawTerminal, error)
func (*RawTerminal) Restore ¶
func (r *RawTerminal) Restore()
func (*RawTerminal) Size ¶
func (r *RawTerminal) Size() (cols, rows uint16, err error)