utils

package
v1.16.9 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMethodFromPrivateKey

func AuthMethodFromPrivateKey(key string) ssh.AuthMethod

AuthMethodFromPrivateKey read public key

func AuthMethodFromPrivateKeyFile

func AuthMethodFromPrivateKeyFile(file string) ssh.AuthMethod

AuthMethodFromPrivateKeyFile read public key

func FileExists

func FileExists(name string) bool

FileExists Check if FileExists

func GetNodeProviderID

func GetNodeProviderID(serverIdentifier string, node *apiv1.Node) string

GetNodeProviderID func

func MaxInt

func MaxInt(x, y int) int

MaxInt max(a,b)

func MinInt

func MinInt(x, y int) int

MinInt min(a,b)

func NodeFromJSON

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

NodeFromJSON deserialize a string to apiv1.Node

func NodeGroupIDFromProviderID

func NodeGroupIDFromProviderID(serverIdentifier string, providerID string) (string, error)

NodeGroupIDFromProviderID returns group node name from provider

func NodeNameFromProviderID

func NodeNameFromProviderID(serverIdentifier string, providerID string) (string, error)

NodeNameFromProviderID return node name from provider ID

func Pipe

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

Pipe execute local command and return output

func Scp

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

Scp copy file

func Shell

func Shell(args ...string) error

Shell execute local command ignore output

func Sudo

func Sudo(connect *types.AutoScalerServerSSH, host string, command ...string) (string, error)

Sudo exec ssh command as sudo

func ToJSON

func ToJSON(v interface{}) string

ToJSON serialize interface to json

Types

This section is empty.

Jump to

Keyboard shortcuts

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