helper

package
v0.8.14 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const CustomSSHPort = 2222
View Source
const StatePath = "state.json"

Variables

This section is empty.

Functions

func CheckLivenessSSH added in v0.5.0

func CheckLivenessSSH(privateKey, serverAddress string) error

func Filter added in v0.8.0

func Filter[T any](s []T, fn func(T) bool) []T

func GenerateSSHKeyPair

func GenerateSSHKeyPair() (string, string, error)

func Map added in v0.8.0

func Map[T any, U any](s []T, fn func(T) U) []U

func ResourceName

func ResourceName(jobID string) string

func SetResourceNamePrefix added in v0.7.0

func SetResourceNamePrefix(prefix string) error

func WaitReachable added in v0.5.0

func WaitReachable(ctx context.Context, privateKey, serverAddress string) error

Types

type SSHClient

type SSHClient struct {
	// contains filtered or unexported fields
}

func NewSSHClient

func NewSSHClient(privateKeyStr, serverIP string, port uint16) (*SSHClient, error)

func (*SSHClient) Close

func (c *SSHClient) Close() error

func (*SSHClient) RunCommand

func (c *SSHClient) RunCommand(ctx context.Context, command string) error

type State

type State struct {
	SSHPrivateKey string
	ServerAddress string
}

func ReadStateFromFile

func ReadStateFromFile(path string) (*State, error)

func (*State) WriteToFile

func (s *State) WriteToFile(path string) error

Jump to

Keyboard shortcuts

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