utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2015 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

scw helpers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachToSerial added in v1.2.0

func AttachToSerial(serverID string, apiToken string, attachStdin bool) error

AttachToSerial tries to connect to server serial using 'term.js-cli' and fallback with a help message

func GetConfigFilePath

func GetConfigFilePath() (string, error)

GetConfigFilePath returns the path to the Scaleway CLI config file

func IsTCPPortOpen

func IsTCPPortOpen(dest string) bool

IsTCPPortOpen returns true if a TCP communication with "host:port" can be initialized

func NewSSHExecCmd

func NewSSHExecCmd(ipAddress string, allocateTTY bool, command []string) []string

NewSSHExecCmd computes execve compatible arguments to run a command via ssh

func PathToTARPathparts

func PathToTARPathparts(fullPath string) (string, string)

PathToTARPathparts returns the two parts of a unix path

func RemoveDuplicates

func RemoveDuplicates(elements []string) []string

RemoveDuplicates transforms an array into a unique array

func SSHExec

func SSHExec(ipAddress string, command []string, checkConnection bool) error

SSHExec executes a command over SSH and redirects file-descriptors

func TruncIf

func TruncIf(str string, max int, cond bool) string

TruncIf ensures the input string does not exceed max size if cond is met

func WaitForTCPPortOpen

func WaitForTCPPortOpen(dest string) error

WaitForTCPPortOpen calls IsTCPPortOpen in a loop

func Wordify

func Wordify(str string) string

Wordify convert complex name to a single word without special shell characters

Types

This section is empty.

Jump to

Keyboard shortcuts

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