Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallSignalPolicy ¶ added in v0.30.0
func InstallSignalPolicy()
InstallSignalPolicy sets the process-wide signal dispositions a host needs.
main calls it first, and not because Host.Run would be late to: Run installs it as its own first statement. It is because most of what this CLI writes never reaches Run at all — cobra's usage and flag errors, `session list`, `version` — and `upterm session list | head` has to survive its reader going away for the same reason `upterm host … | head` does.
The policy itself belongs to host, not here: an application that embeds Host.Run never runs upterm's main, and the disposition is a property of hosting a session rather than of being this CLI. The platform difference lives there too — Windows has no SIGPIPE to convert — which is why this file needs no build tag.
Types ¶
type AutoAllowPermissionChecker ¶ added in v0.22.0
type AutoAllowPermissionChecker struct{}
AutoAllowPermissionChecker always allows operations (for --accept mode or testing).
func (*AutoAllowPermissionChecker) CheckPermission ¶ added in v0.22.0
func (a *AutoAllowPermissionChecker) CheckPermission(op sftp.Operation, client sftp.ClientInfo, paths ...string) (sftp.PermissionResult, error)
CheckPermission always returns PermissionAllowed.
func (*AutoAllowPermissionChecker) ClearSession ¶ added in v0.22.0
func (a *AutoAllowPermissionChecker) ClearSession(sessionID string)
ClearSession is a no-op since AutoAllowPermissionChecker doesn't track sessions.
type DialogPermissionChecker ¶ added in v0.22.0
type DialogPermissionChecker struct {
// contains filtered or unexported fields
}
DialogPermissionChecker shows GUI dialogs for permission prompts.
func (*DialogPermissionChecker) CheckPermission ¶ added in v0.22.0
func (d *DialogPermissionChecker) CheckPermission(op sftp.Operation, client sftp.ClientInfo, paths ...string) (sftp.PermissionResult, error)
CheckPermission shows a dialog for the operation. For two-path operations (rename, symlink, link), both source and target paths are passed.
func (*DialogPermissionChecker) ClearSession ¶ added in v0.22.0
func (d *DialogPermissionChecker) ClearSession(sessionID string)
ClearSession removes cached permissions for the given session.
type ExitCodeError ¶ added in v0.30.0
ExitCodeError carries an exit status for main to use. Err is what cobra prints; main exits with Code, and says nothing more — logging Err again would put the same sentence on stderr twice.
func (ExitCodeError) Error ¶ added in v0.30.0
func (e ExitCodeError) Error() string
func (ExitCodeError) Unwrap ¶ added in v0.30.0
func (e ExitCodeError) Unwrap() error
type SilentError ¶ added in v0.22.0
type SilentError struct {
Err error
}
SilentError wraps an error that has already been displayed to the user. main.go checks for this type to avoid duplicate logging.
func (SilentError) Error ¶ added in v0.22.0
func (e SilentError) Error() string
func (SilentError) Unwrap ¶ added in v0.22.0
func (e SilentError) Unwrap() error
type UserDiscardedError ¶ added in v0.15.0
type UserDiscardedError struct{}
UserDiscardedError represents a user's intentional choice to discard the session
func (UserDiscardedError) Error ¶ added in v0.15.0
func (e UserDiscardedError) Error() string
func (UserDiscardedError) Unwrap ¶ added in v0.30.0
func (e UserDiscardedError) Unwrap() error
Unwrap makes a discard an abandoned startup rather than a failed one.
displaySession returns this from SessionCreatedCallback, and Host records every error from there as startup_failed unless it wraps ErrSessionAbandoned. Nothing failed here: the operator was shown the session and said no, and a record saying otherwise sends whoever reads it looking for a fault that never happened.
type UserInterruptedError ¶ added in v0.15.0
type UserInterruptedError struct{}
UserInterruptedError represents a user's Ctrl+C interruption
func (UserInterruptedError) Error ¶ added in v0.15.0
func (e UserInterruptedError) Error() string
func (UserInterruptedError) Unwrap ¶ added in v0.30.0
func (e UserInterruptedError) Unwrap() error
Unwrap makes an interruption an abandoned startup rather than a failed one, for the same reason UserDiscardedError.Unwrap does: nothing failed, the operator hit Ctrl+C at the prompt instead of answering it.
Source Files
¶
- attach.go
- authorized_user_flag.go
- config.go
- daemon.go
- host.go
- host_unix.go
- join.go
- join_echo_unix.go
- join_linux.go
- join_status.go
- localclient.go
- privacy.go
- proxy.go
- proxy_flag.go
- resize_unix.go
- root.go
- session.go
- sftp_permission.go
- signal.go
- signals_unix.go
- spawn_hello.go
- spawn_unix.go
- spawned.go
- suspend_unix.go
- terminal.go
- upgrade.go
- version.go