utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRoot = &Account{
	Username: "root",
	Password: "root",
}

Functions

func CheckKubectlVersion

func CheckKubectlVersion(compareMinor int) error

func CopyDir

func CopyDir(src string, dst string) (err error)

CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist Symlinks are ignored and skipped.

func CopyFile

func CopyFile(src, dst string) (err error)

func GetHomePath

func GetHomePath() string

func GetNhctlBinName

func GetNhctlBinName() string

func GetNhctlPath

func GetNhctlPath() (string, error)

func GetPortForwardForString

func GetPortForwardForString(portStr string) (int, int, error)

portStr is like 8080:80, :80 or 80

func GetShortUuid

func GetShortUuid() (string, error)

func IsSudoUser

func IsSudoUser() bool

func IsWindows

func IsWindows() bool

func RecoverFromPanic

func RecoverFromPanic()

func ReplaceCodingcorpString

func ReplaceCodingcorpString(old string) string

func Reverse

func Reverse(account *Account, sshEndpoint, remoteEndpoint, localEndpoint string) (err error)

func Sha1ToString

func Sha1ToString(str string) string

func Should

func Should(err error)

func ShouldI

func ShouldI(err error, info string)

With info

Types

type Account

type Account struct {
	Username string
	Password string
}

type Printer

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

func NewPrinter

func NewPrinter(printerFunc func(string)) *Printer

func (*Printer) ChangeContent

func (se *Printer) ChangeContent(content string)

func (*Printer) Done

func (se *Printer) Done()

type Spinner

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

func NewSpinner

func NewSpinner(suffix string) *Spinner

NewSpinner returns a new Spinner

func (*Spinner) Start

func (p *Spinner) Start()

Start starts the spinner

func (*Spinner) Stop

func (p *Spinner) Stop()

Stop stops the spinner

func (*Spinner) Update

func (p *Spinner) Update(text string)

Update updates the spinner message

Jump to

Keyboard shortcuts

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