utils

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package utils -- Utility functions to be used throughout cmd. Kind of decided that this was a pretty decent way of doing shared logic for

cmd.

Basically the same as for pkg, so nothing too special there, but since cmd

has a bit of nesting, it brings up some more questions.

It seems like golang itself does a pattern like this for `base` cmd units,

so this is probably not too shabby.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAnyMaster

func GetAnyMaster() (hope.Node, error)

func GetAvailableMasters added in v0.17.2

func GetAvailableMasters() ([]hope.Node, error)

GetAvailableMasters -- Returns the list of master nodes that can be reached

in one way or another.

Doesn't confirm if the masters are configured, or are in the load balanced

set of masters; only that the node exists on its defined hypervisor.

func GetHypervisor added in v0.15.0

func GetHypervisor(name string) (hypervisors.Hypervisor, error)

func GetHypervisors added in v0.15.0

func GetHypervisors() ([]hypervisors.Hypervisor, error)

func GetIdentifiableResources

func GetIdentifiableResources(names *[]string, tags *[]string) (*[]hope.Resource, error)

func GetJob

func GetJob(jobName string) (*hope.Job, error)

func GetJobs

func GetJobs() (*[]hope.Job, error)

func GetLoadBalancer added in v0.17.0

func GetLoadBalancer() (hope.Node, error)

func GetNode

func GetNode(name string) (hope.Node, error)

func GetResources

func GetResources() (*[]hope.Resource, error)

func GetVMs added in v0.15.0

func GetVMs() (*hope.VMs, error)

func HasNode added in v0.15.3

func HasNode(name string) bool

HasNode -- Check whether a node has been defined in the hope file, even if

the node doesn't exist on its hypervisor yet.

func KubectlFromAnyMaster added in v0.15.2

func KubectlFromAnyMaster() (*kubeutil.Kubectl, error)

func ReplaceParametersInDirectoryCopy added in v0.15.0

func ReplaceParametersInDirectoryCopy(dir string, parameters []string) (string, error)

ReplaceParametersInDirectoryCopy - Copy the provided directory, and replace

parameters in the files.

Returns the temp path to the copied directory, and the caller must clean up

that directory itself, unless an error occurs.

func ReplaceParametersInFile

func ReplaceParametersInFile(path string, parameters []string) (string, error)

func ReplaceParametersInString

func ReplaceParametersInString(str string, parameters []string) (string, error)

func ReplaceParametersWithSubstitutor

func ReplaceParametersWithSubstitutor(t *hope.TextSubstitutor, parameters []string) (string, error)

func VMSpec added in v0.15.0

func VMSpec(vmName string) (*hope.VMImageSpec, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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