helpers

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UserDir       = "HOME"
	PathSeparator = "/"
)

Variables

This section is empty.

Functions

func CreateSSHKeyPair

func CreateSSHKeyPair(log resources.LoggerFactory, state *types.StorageDocument) error

func ExecuteScript added in v1.1.4

func ExecuteScript(log resources.LoggerFactory, conn *ssh.Client, script string) (stdout string, stderr string, err error)

func GenRandomString added in v1.1.4

func GenRandomString(length int) (string, error)

GenRandomString it generates RandomString

func GenerateCerts added in v1.1.4

func GenerateCerts(log resources.LoggerFactory, etcdMemPrivAddr []string) (caCert string, etcdCert string, etcdKey string, err error)

func GenerateInitScriptForVM added in v1.1.4

func GenerateInitScriptForVM(resName string) (string, error)

func GetUserName

func GetUserName() string

GetUserName returns current active username

func IsValidName

func IsValidName(clusterName string) error

func NewScriptCollection added in v1.1.4

func NewScriptCollection() resources.ScriptCollection

func UserInputCredentials

func UserInputCredentials(logging resources.LoggerFactory) (string, error)

func ValidCNIPlugin

func ValidCNIPlugin(cni consts.KsctlValidCNIPlugin) bool

func ValidateCloud

func ValidateCloud(cloud consts.KsctlCloud) bool

func ValidateDistro

func ValidateDistro(distro consts.KsctlKubernetes) bool

func ValidateStorage

func ValidateStorage(storage consts.KsctlStore) bool

func WriteKubeConfig

func WriteKubeConfig(kubeconfig string) (string, error)

Types

type SSHCollection

type SSHCollection interface {
	SSHExecute(resources.LoggerFactory) error
	Flag(consts.KsctlUtilsConsts) SSHCollection
	Script(resources.ScriptCollection) SSHCollection
	FastMode(bool) SSHCollection
	Username(string)
	PrivateKey(string)
	GetOutput() []string
	IPv4(ip string) SSHCollection
}

func NewSSHExecutor added in v1.1.4

func NewSSHExecutor(mainStateDocument *types.StorageDocument) SSHCollection

type SSHPayload

type SSHPayload struct {
	UserName   string
	Privatekey string
	PublicIP   string
	Output     []string
	// contains filtered or unexported fields
}

func (*SSHPayload) FastMode

func (sshPayload *SSHPayload) FastMode(mode bool) SSHCollection

func (*SSHPayload) Flag

func (sshPayload *SSHPayload) Flag(execMethod consts.KsctlUtilsConsts) SSHCollection

func (*SSHPayload) GetOutput

func (sshPayload *SSHPayload) GetOutput() []string

func (*SSHPayload) IPv4

func (sshPayload *SSHPayload) IPv4(ip string) SSHCollection

func (*SSHPayload) PrivateKey

func (sshPayload *SSHPayload) PrivateKey(s string)

func (*SSHPayload) SSHExecute

func (sshPayload *SSHPayload) SSHExecute(log resources.LoggerFactory) error

func (*SSHPayload) Script

func (sshPayload *SSHPayload) Script(s resources.ScriptCollection) SSHCollection

func (*SSHPayload) Username

func (sshPayload *SSHPayload) Username(s string)

type Scripts added in v1.1.4

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

Scripts is goroutine safe

func (*Scripts) Append added in v1.1.4

func (s *Scripts) Append(script resources.Script)

func (*Scripts) IsCompleted added in v1.1.4

func (s *Scripts) IsCompleted() bool

func (*Scripts) NextScript added in v1.1.4

func (s *Scripts) NextScript() *resources.Script

func (*Scripts) String added in v1.1.4

func (s *Scripts) String() string

func (*Scripts) TestAllScripts added in v1.1.4

func (s *Scripts) TestAllScripts() []resources.Script

func (*Scripts) TestLen added in v1.1.4

func (s *Scripts) TestLen() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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