ssh

package
v0.0.0-...-78dbea0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SSHRetryDelay is the time to wait for an SSH connection to be established
	// to a single endpoint of a target.
	SSHRetryDelay = 2 * time.Second

	// SSHTimeout is the time to wait for all SSH negotiation and authentication process.
	SSHTimeout = 20 * time.Second
)

Variables

View Source
var DefaultSSHPublicKeyRetryStrategy = retry.CallArgs{
	Clock:       clock.WallClock,
	MaxDelay:    60 * time.Second,
	Delay:       1 * time.Second,
	Attempts:    10,
	BackoffFunc: retry.DoubleDelay,
}
View Source
var DefaultSSHRetryStrategy = retry.CallArgs{
	Clock:       clock.WallClock,
	MaxDuration: SSHTimeout,
	Delay:       SSHRetryDelay,
}

Functions

func NewDebugCodeCommand

func NewDebugCodeCommand(hostChecker ssh.ReachableChecker, retryStrategy retry.CallArgs, publicKeyRetryStrategy retry.CallArgs) cmd.Command

func NewDebugHooksCommand

func NewDebugHooksCommand(hostChecker ssh.ReachableChecker, retryStrategy retry.CallArgs, publicKeyRetryStrategy retry.CallArgs) cmd.Command

func NewSCPCommand

func NewSCPCommand(hostChecker jujussh.ReachableChecker, retryStrategy retry.CallArgs, publicKeyRetryStrategy retry.CallArgs) cmd.Command

func NewSSHCommand

func NewSSHCommand(
	hostChecker jujussh.ReachableChecker,
	isTerminal func(interface{}) bool,
	retryStrategy retry.CallArgs,
	publicKeyRetryStrategy retry.CallArgs,
) cmd.Command

Types

type ApplicationAPI

type ApplicationAPI interface {
	Leader(string) (string, error)
	Close() error
	UnitsInfo(units []names.UnitTag) ([]application.UnitInfo, error)
}

ApplicationAPI defines application related APIs.

type CharmsAPI

type CharmsAPI interface {
	Close() error
	CharmInfo(charmURL string) (*commoncharm.CharmInfo, error)
}

type CloudCredentialAPI

type CloudCredentialAPI interface {
	Cloud(tag names.CloudTag) (jujucloud.Cloud, error)
	CredentialContents(cloud, credential string, withSecrets bool) ([]params.CredentialContentResult, error)
	BestAPIVersion() int
	Close() error
}

CloudCredentialAPI defines cloud credential related APIs.

type Context

type Context interface {
	InterruptNotify(c chan<- os.Signal)
	StopInterruptNotify(c chan<- os.Signal)
	GetStdout() io.Writer
	GetStderr() io.Writer
	GetStdin() io.Reader
}

Context defines methods for command context.

type LeaderAPI

type LeaderAPI interface {
	Leader(string) (string, error)
	Close() error
}

LeaderAPI is implemented by types that can query for a Leader based on application name.

type ModelCommand

type ModelCommand interface {
	NewControllerAPIRoot() (api.Connection, error)
	ModelDetails() (string, *jujuclient.ModelDetails, error)
	NewAPIRoot() (api.Connection, error)
	NewAPIClient() (*apiclient.Client, error)
	ModelIdentifier() (string, error)
}

ModelCommand defines methods of the model command.

type SSHClientAPI

type SSHClientAPI interface {
	Close() error
	ModelCredentialForSSH() (cloudspec.CloudSpec, error)
}

SSHClientAPI defines ssh client related APIs.

type SSHControllerAPI

type SSHControllerAPI interface {
	ControllerConfig() (controller.Config, error)
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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