Help us shape the future of Go! Take the 2026 Go Developer Survey

ssh

package
v0.4.119 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSshUsername = "root"

Variables

This section is empty.

Functions

func Connect added in v0.0.557

func Connect(p *ConnectParams, addr string) (*ssh.Client, error)

func Console added in v0.0.557

func Console(ctx context.Context, sshClient *ssh.Client, cmd string, allocPTY bool, target SessionTarget) error

func MarshalED25519PrivateKey added in v0.0.359

func MarshalED25519PrivateKey(key ed25519.PrivateKey, comment string) []byte

stolen from `mikesmitty`, thanks, you are a mikesmitty and a scholar

func New added in v0.0.359

func New() *cobra.Command

New initializes and returns a new apps Command.

func NewSFTP added in v0.0.410

func NewSFTP() *cobra.Command

func RunSSHCommand

func RunSSHCommand(ctx context.Context, org OrganizationImpl, appName string, dialer agent.Dialer, addr string, cmd string, username string) ([]byte, error)

func SSHConnect

func SSHConnect(p *SSHParams, addr string) error

Types

type ConnectParams added in v0.0.557

type ConnectParams struct {
	Ctx            context.Context
	Org            OrganizationImpl
	Username       string
	Dialer         agent.Dialer
	DisableSpinner bool
	Container      string
	// Machine connects to the machine itself rather than to one of its
	// containers. It is mutually exclusive with Container.
	Machine  bool
	AppNames []string
}

type OrganizationImpl added in v0.3.221

type OrganizationImpl interface {
	GetID() string
	GetSlug() string
}

type SSHParams

type SSHParams struct {
	Ctx            context.Context
	Org            OrganizationImpl
	App            string
	Username       string
	Dialer         agent.Dialer
	Cmd            string
	Stdin          io.Reader
	Stdout         io.WriteCloser
	Stderr         io.WriteCloser
	DisableSpinner bool
}

type SessionTarget added in v0.4.83

type SessionTarget = ssh.SessionTarget

SessionTarget selects where a session runs on the remote machine.

Notes

Bugs

  • do better

  • these return `error` because in theory an error might be bad enough that we want to kill the session, but nothing does that right now.

Jump to

Keyboard shortcuts

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