utils

package
v1.31.0-dev Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMethodFromPrivateKey

func AuthMethodFromPrivateKey(key string) (ssh.AuthMethod, error)

AuthMethodFromPrivateKey read public key

func AuthMethodFromPrivateKeyFile

func AuthMethodFromPrivateKeyFile(file string) (ssh.AuthMethod, error)

AuthMethodFromPrivateKeyFile read public key

func DirExistAndReadable

func DirExistAndReadable(name string) bool

func FileExistAndReadable

func FileExistAndReadable(name string) bool

func FileExists

func FileExists(name string) bool

FileExists Check if FileExists

func GetConfigFile added in v1.30.0

func GetConfigFile() (config string)

func GetMachinesConfigFile added in v1.30.0

func GetMachinesConfigFile() (config string)

func GetProviderConfigFile added in v1.30.0

func GetProviderConfigFile() (config string)

func GetServerConfigFile added in v1.30.0

func GetServerConfigFile() (config string)

func GetTestMode added in v1.30.0

func GetTestMode() bool

func LoadConfig added in v1.30.0

func LoadConfig(fileName string, config any) (err error)

func LoadTextEnvSubst added in v1.30.0

func LoadTextEnvSubst(fileName string) (string, error)

func MaxInt

func MaxInt(x, y int) int

MaxInt max(a,b)

func MaxInt64

func MaxInt64(x, y int64) int64

MaxInt64 max(a,b)

func MinInt

func MinInt(x, y int) int

MinInt min(a,b)

func MinInt64

func MinInt64(x, y int64) int64

MinInt64 min(a,b)

func NewRequestContext

func NewRequestContext(requestTimeout time.Duration) *context.Context

func NodeFromJSON

func NodeFromJSON(s string) (*apiv1.Node, error)

NodeFromJSON deserialize a string to apiv1.Node

func Scp

func Scp(connect *sshutils.AutoScalerServerSSH, host, src, dst string) error

Scp copy file

func Shell

func Shell(args ...string) (string, error)

Shell execute local command ignore output

func ShouldTestFeature

func ShouldTestFeature(name string) bool

ShouldTestFeature check if test must be done

func Sudo

func Sudo(connect *sshutils.AutoScalerServerSSH, host string, timeoutInSeconds time.Duration, command ...string) (string, error)

Sudo exec ssh command as sudo

func ToJSON

func ToJSON(v any) string

ToJSON serialize interface to json

func ToYAML

func ToYAML(v any) string

ToYAML serialize interface to yaml

func Values

func Values[M ~map[K]V, K comparable, V any](m M) []V

Values returns the values of the map m. The values will be in an indeterminate order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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