Documentation
¶
Index ¶
- Variables
- func CheckAndConvertInt(num string, name string) int
- func CheckAndConvertInt64(num string, name string) int64
- func CheckArguments(cmd *cobra.Command, args []string, min int, max int)
- func CheckIntegerBounds(cmd *cobra.Command, name string, val int, min int, max int)
- func ClientNotSupported(client string)
- func CreateAuthNHeader() (string, error)
- func DeleteStore(name string) error
- func GetEnvVar(envVar, fallback string) string
- func HttpRequest(method string, url string, bodyData string) ([]byte, error)
- func InvalidArgument(arg string)
- func InvalidInteger(name string, value string, fatal bool)
- func JwtHTTPRequest(method string, url string, bodyData string) (string, error)
- func PartialCommand(cmd *cobra.Command, args []string)
- func PrintError(err error)
- func PrintErrorFatal(err error)
- func PrintStringError(err string)
- func ReadStore(name string) ([]byte, error)
- func StoreExists(name string) bool
- func UnrollStringSliceToMapIntString(slices []string, delim string) (map[int]string, []string, error)
- func UnrollStringSliceToMapStringString(slices []string, delim string) (map[string]string, error)
- func Write(path string, data []byte) error
- func WriteStore(name string, data []byte) error
- func YesNoPrompt(msg string) bool
- type SshClient
- func (this SshClient) Close()
- func (this SshClient) DockerExec(node int, command string) (string, error)
- func (this SshClient) DockerExecd(node int, command string) (string, error)
- func (this SshClient) DockerMultiExec(node int, commands []string) (string, error)
- func (this SshClient) DockerRead(node int, file string) (string, error)
- func (this SshClient) FastMultiRun(commands ...string) (string, error)
- func (this SshClient) GetSession() (*ssh.Session, error)
- func (this SshClient) MultiRun(commands ...string) ([]string, error)
- func (this SshClient) Run(command string) (string, error)
- func (this SshClient) Scp(src string, dest string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ApiBaseURL = GetEnvVar(ApiEnvVar, DEFAULT_API_BASE_URL)
View Source
var ApiEnvVar = "API_URL"
View Source
var DEFAULT_API_BASE_URL = "https://api.whiteblock.io"
Functions ¶
func CheckAndConvertInt ¶
func CheckAndConvertInt64 ¶
func CheckIntegerBounds ¶
func ClientNotSupported ¶
func ClientNotSupported(client string)
func CreateAuthNHeader ¶ added in v1.7.1
func DeleteStore ¶
func GetEnvVar ¶ added in v1.7.7
Get API_BASE_URL from the environment variable API_URL or fallback to the default
func HttpRequest ¶
Sends an http request and returns the body. Gives an error if the http request failed or returned a non success code.
func InvalidArgument ¶
func InvalidArgument(arg string)
func InvalidInteger ¶
func JwtHTTPRequest ¶ added in v1.7.1
JwtHTTPRequest is similar to HttpRequest, but it have the content-type set as application/json and it will put the given jwt in the auth header
func PartialCommand ¶
func PrintError ¶
func PrintError(err error)
func PrintErrorFatal ¶
func PrintErrorFatal(err error)
func PrintStringError ¶
func PrintStringError(err string)
func StoreExists ¶
func UnrollStringSliceToMapIntString ¶ added in v1.6.3
func UnrollStringSliceToMapStringString ¶ added in v1.6.3
func Write ¶
Write writes data to a file, creating it if it doesn't exist, deleting and recreating it if it does.
func WriteStore ¶
func YesNoPrompt ¶
Types ¶
type SshClient ¶
type SshClient struct {
// contains filtered or unexported fields
}
func NewSshClient ¶
func (SshClient) DockerExec ¶
func (SshClient) DockerExecd ¶
func (SshClient) DockerMultiExec ¶
func (SshClient) DockerRead ¶
func (SshClient) FastMultiRun ¶
*
- Speeds up remote execution by chaining commands together
- @param ...string commands The commands to execute
- @return string The result of the execution
Click to show internal directories.
Click to hide internal directories.