utils

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBlueprintPath = "blueprint.yaml"

Variables

This section is empty.

Functions

func ExecCommand

func ExecCommand(name string) error

ExecCommand executes a command and returns an error if it fails.

func ExecCommandQuietly

func ExecCommandQuietly(name string, args ...string) error

ExecCommandQuietly executes a command and returns an error if it fails without any stdout

func ExecCommandWithReturn

func ExecCommandWithReturn(name string) (string, error)

ExecCommandWithReturn executes a command and returns the output as a string.

func LoadBlueprint

func LoadBlueprint(path string) (types.Blueprint, error)

func PrintDaemonsetStatus

func PrintDaemonsetStatus(ds v1.DaemonSet)

func PrintDeploymentStatus

func PrintDeploymentStatus(deployment v1.Deployment)

func PrintStatefulsetStatus

func PrintStatefulsetStatus(ss v1.StatefulSet)

func ReadFile

func ReadFile(path string) ([]byte, error)

func ReadURI

func ReadURI(uri string) ([]byte, error)

ReadURI reads the content of a URI. The URI argument can be a file path or a URL. @TODO: Make this function testable by injecting a reader for file and http requests.

func RemoteCommand

func RemoteCommand(user string, addr string, privateKey string, cmd string) (string, string, error)

RemoteCommand takes user, addr and privateKey and initiates an SSH session. It then runs the provided cmd and returns stdout, stderr output and error.

func WriteTempFile

func WriteTempFile(data []byte, pattern string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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