Documentation
¶
Index ¶
- Constants
- func Contains(slice []string, searchValue string) bool
- func CreateDeployOutputFile(deployOutput *DeployOutput)
- func FileToBase64(filepath string) string
- func Flock(f *os.File) error
- func Funlock(f *os.File) error
- func GenerateMachineUniqueName() string
- func GenerateUserName() string
- func GetSubnets(svc *ec2.Client, vpcId *string) []types.Subnet
- func GetVpcs(svc *ec2.Client) *ec2.DescribeVpcsOutput
- func NextApplyDir(path string) (applyDirName string, nextApplyDirError error)
- func ParseDotEnvFile(dotEnvFile string) ([]string, error)
- func SSHIntoVM(request SSHIntoVMRequest)
- func StringSliceToPointerSlice(strSlice []string) []*string
- func WhichCloudProvider() string
- type CopyAndRunRemoteFileConfig
- type DeployOutput
- type Forward
- type Forwarder
- type Remote
- func (r *Remote) CopyAndRunRemoteFile(config *CopyAndRunRemoteFileConfig) error
- func (r *Remote) DownloadFile(srcPath, dstPath string) error
- func (r *Remote) NewSSHConnection() error
- func (r *Remote) ReadPassphrase() (string, error)
- func (r *Remote) RemoteRun(remoteRunConfig *RemoteRunConfig) (string, error)
- func (r *Remote) SCPCopyFileWithProgress(srcPath, dstPath string, progressCallback func(current, total int64)) error
- func (r *Remote) SSHCopyFileWithProgress(srcPath, dstPath string, progressCallback func(current, total int64)) error
- func (r *Remote) SSHUploadDir(srcDir, dstDir string, totalBytes int64, ...) error
- func (r *Remote) WaitForCloudInit(timeout string)
- func (r *Remote) WaitForSSH(timeout string)
- type RemoteRunConfig
- type SSHIntoVMRequest
Constants ¶
const (
ONCTLDIR = ".onctl"
)
Variables ¶
This section is empty.
Functions ¶
func CreateDeployOutputFile ¶
func CreateDeployOutputFile(deployOutput *DeployOutput)
func FileToBase64 ¶ added in v0.1.2
func GenerateMachineUniqueName ¶
func GenerateMachineUniqueName() string
func GenerateUserName ¶ added in v0.1.2
func GenerateUserName() string
func NextApplyDir ¶ added in v0.1.6
func ParseDotEnvFile ¶ added in v0.1.8
func SSHIntoVM ¶
func SSHIntoVM(request SSHIntoVMRequest)
func WhichCloudProvider ¶
func WhichCloudProvider() string
Types ¶
type CopyAndRunRemoteFileConfig ¶ added in v0.1.6
type DeployOutput ¶
type Forward ¶ added in v0.1.34
type Forward struct {
Local string // host:port to listen on; port 0 picks a free one
RemoteHost string // usually localhost: the VM itself
RemotePort int
}
Forward is one port forward: connections to Local on this machine are carried over ssh to RemoteHost:RemotePort as seen from the VM (ssh -L).
func ParseForward ¶ added in v0.1.34
ParseForward parses REMOTE, LOCAL:REMOTE or LOCAL:HOST:REMOTE (ssh -L's form, minus the bind address, which is bind). REMOTE alone listens on the same port number locally.
type Forwarder ¶ added in v0.1.34
type Forwarder struct {
Remote *Remote
// contains filtered or unexported fields
}
Forwarder carries port forwards over one ssh connection to a VM, reconnecting once if that connection has dropped (a VM paused and resumed, a laptop that slept).
type Remote ¶ added in v0.1.6
type Remote struct {
Username string
IPAddress string
SSHPort int
PrivateKey string
Passphrase string
Spinner *ui.Spinner
Client *ssh.Client
DialTimeout time.Duration // 0 means default (7s); set to a shorter value for fast-retry polling
// Dial, when set, opens the connection to the VM's port instead of a
// TCP dial to IPAddress -- for providers whose VMs have no reachable
// address (cloud.Dialer).
Dial func(ctx context.Context, port int) (net.Conn, error)
}
func (*Remote) CopyAndRunRemoteFile ¶ added in v0.1.6
func (r *Remote) CopyAndRunRemoteFile(config *CopyAndRunRemoteFileConfig) error
creates a new apply dir and copies the file to the remote ex. ~/.onctl/apply01 executes the file on the remote
func (*Remote) DownloadFile ¶ added in v0.1.9
func (*Remote) NewSSHConnection ¶ added in v0.1.6
func (*Remote) ReadPassphrase ¶ added in v0.1.17
func (*Remote) RemoteRun ¶ added in v0.1.6
func (r *Remote) RemoteRun(remoteRunConfig *RemoteRunConfig) (string, error)
func (*Remote) SCPCopyFileWithProgress ¶ added in v0.1.22
func (*Remote) SSHCopyFileWithProgress ¶ added in v0.1.22
func (*Remote) SSHUploadDir ¶ added in v0.1.24
func (r *Remote) SSHUploadDir(srcDir, dstDir string, totalBytes int64, progressCallback func(current, total int64)) error
SSHUploadDir recursively uploads a local directory to a remote path via SFTP. totalBytes should be the pre-calculated total size of the directory for progress reporting.
func (*Remote) WaitForCloudInit ¶ added in v0.1.6
WaitForCloudInit waits for cloud-init to finish
func (*Remote) WaitForSSH ¶ added in v0.1.24
WaitForSSH waits until an SSH connection to the remote can be established. It is used by providers (e.g. Firecracker) whose microVMs have no cloud-init readiness signal to wait on.