common

package
v0.0.0-...-5a14af6 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2018 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const DownloaderStereotypeExample = "stereotype-github-example"
View Source
const DownloaderStereotypeQuickstart = "stereotype-github-quickstart"

Variables

View Source
var VerboseLogging bool

Functions

func AttachBoolArg

func AttachBoolArg(cmd *cobra.Command, parmType reflect.Type, variableName string, variableValue *bool)

func AttachIntArg

func AttachIntArg(cmd *cobra.Command, parmType reflect.Type, variableName string, variableValue *int)

func AttachStringArg

func AttachStringArg(cmd *cobra.Command, parmType reflect.Type, variableName string, variableValue *string, otherArgs ...string)

AttachStringArg uses reflection to read the provided struct to determine the arguments. otherArgs has the first argument is the defaultDefault value that overrides anything defined in the struct argument tag.

func Command

func Command(program string, args []string, dir string, shortDesc string) (string, error)

func DeleteAndVerifyNamespace

func DeleteAndVerifyNamespace(parms DeleteNamespaceParms, api corev1.CoreV1Interface) error

DeleteAndVerifyNamespace deletes the namespace and verifies it is removed up to a timeout period

func DownloadZipFromURL

func DownloadZipFromURL(url, destFile string) error

func EnsureFowardSlashAtStringEnd

func EnsureFowardSlashAtStringEnd(valDir string) string

EnsureFowardSlashAtStringEnd makes such "/" is at the end of a string (useful for file processing). Note: this isn't useful for all file systems, but good enough for Unix and Windows-style OSes.

func GenerateFromGenericExampleWithHelmHandler

func GenerateFromGenericExampleWithHelmHandler(parms GenercExamplesDownloadParms) error

GenerateFromGenericExampleWithHelmHandler downloads and processes a template application from https://github.com/Activiti/example-runtime-bundle

func GenerateFromGenericQuickStartHandler

func GenerateFromGenericQuickStartHandler(parms GenercQuickstartDownloadParms) (localTransformsCount int, err error)

GenerateFromGenericQuickStartHandler downloads and processes a template application from https://github.com/Activiti/activiti-cloud-runtime-bundle-quickstart/ or https://github.com/Activiti/activiti-cloud-connector-quickstart/

func LoadKubernetesAPI

func LoadKubernetesAPI() (corev1.CoreV1Interface, error)

LoadKubernetesAPI loads Kubernetes api from the user's home directory and ".kube/config"

func LoadURLInBrowser

func LoadURLInBrowser(url, oneWordDescription, optionalHint string) error

func LogError

func LogError(msg string)

LogError does Println with conditional ERROR prefix based on platform

func LogExit

func LogExit(msg string)

LogExit does Println with conditional EXIT prefix based on platform and then ends the process with os.Exit(1)

func LogInfo

func LogInfo(msg string)

LogInfo does Println with conditional INFO prefix based on platform

func LogNotImplemented

func LogNotImplemented(msg string)

LogNotImplemented does Println with conditional UNFINISHED prefix based on platform

func LogOK

func LogOK(msg string)

LogOK does Println with conditional OK prefix based on platform

func LogTime

func LogTime(msg string)

LogTime does Println with conditional TIME prefix based on platform

func LogWaitingForUser

func LogWaitingForUser(msg string)

LogWaitingForUser does Println with conditional USERINPUT prefix based on platform

func LogWarn

func LogWarn(msg string)

LogWarn does Println with conditional WARN prefix based on platform

func LogWorking

func LogWorking(msg string)

LogWorking does Println with conditional WORKING prefix based on platform

func MarkCommand

func MarkCommand(cmd *cobra.Command, parm interface{}, parmMap map[string]string, validator *validator.Validate)

func NewValidator

func NewValidator() *validator.Validate

NewValidator instanciates a new validator.

func NonInteractiveAvailableURLMsg

func NonInteractiveAvailableURLMsg(url, oneWordDescription, credentials string)

func UnzipFromFileToDir

func UnzipFromFileToDir(src, dest string) (outputDir string, err error)

func VerifyPodsReady

func VerifyPodsReady(parms VerifyParms, api corev1.CoreV1Interface) error

VerifyPodsReady looks at all of the pods in a namespace and confirms all services are running in the namespace running returning <nil> if successful. If the are not, the status is polled returning <nil> when the services are up-and-running or until the timeout period at which time an error is throw.

func WaitForSpaceBar

func WaitForSpaceBar()

Types

type Argument

type Argument struct {
	Required        bool
	LongName        string
	ShortName       string
	HasDefaultValue bool
	DefaultValue    string
}

func ParseArgFromField

func ParseArgFromField(field reflect.StructField) (argument Argument, err error)

type DeleteNamespaceParms

type DeleteNamespaceParms struct {
	Namespace                     string
	TimeoutSeconds                int
	QueryForAllPodsRunningSeconds int
}

DeleteNamespaceParms represents the parms for verifying that all of the pods in the namespace are running

type GenercExamplesDownloadParms

type GenercExamplesDownloadParms struct {
	BundleName     string
	PackageName    string
	TagName        string
	DestinationDir string
	DownloadURL    string
}

type GenercQuickstartDownloadParms

type GenercQuickstartDownloadParms struct {
	BundleName           string
	PackageName          string
	ProjectName          string
	TagName              string
	DestinationDir       string
	DownloadURL          string
	AdditionalTransCount int
}

GenercQuickstartDownloadParms are parameters for download handling

type InstallParms

type InstallParms struct {
	ChartName                     string
	CustomRepo                    bool
	HelmRepo                      string
	ValuesDir                     string
	Namespace                     string
	TimeoutSeconds                int
	QueryForAllPodsRunningSeconds int
}

InstallParms represent the parms for starting and verifying that all of the pods in the namespace are running

type SimpleProjectObjectModel

type SimpleProjectObjectModel struct {
	GroupID    string `xml:"groupId"`
	ArtifactID string `xml:"artifactId"`
}

func GetProjectObjectModelFromCurrentDir

func GetProjectObjectModelFromCurrentDir() (answer SimpleProjectObjectModel, err error)

type SimpleProp

type SimpleProp struct {
	SpringAppName string
}

func GetSimpleProp

func GetSimpleProp(filePath string) (SimpleProp, error)

type VerifyParms

type VerifyParms struct {
	Namespace                     string
	TimeoutSeconds                int
	QueryForAllPodsRunningSeconds int
}

VerifyParms represents the parms for verifying that all of the pods in the namespace are running

Jump to

Keyboard shortcuts

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