Documentation ¶
Index ¶
- Constants
- func ConvertKeyValueStringToMap(params []string) map[string]string
- func ConvertLabelsToSelector(labels map[string]string) string
- func ExtractComponentType(namespacedVersionedComponentType string) string
- func GenFileUrl(location string, os string) string
- func GenerateRandomString(n int) string
- func GetDNS1123Name(str string) string
- func GetRandomName(prefix string, prefixMaxLen int, existList []string, retries int) (string, error)
- func NamespaceOpenShiftObject(componentName string, applicationName string) (string, error)
- func OpenBrowser(url string) error
- func ParseCreateCmdArgs(args []string) (string, string, string, string)
- func ReadFilePath(u *url.URL, os string) string
- func SliceDifference(s1 []string, s2 []string) []string
- func TruncateString(str string, maxLen int) string
Constants ¶
const WIN = "windows"
Variables ¶
This section is empty.
Functions ¶
func ConvertKeyValueStringToMap ¶ added in v0.0.14
ConvertKeyValueStringToMap converts String Slice of Parameters to a Map[String]string Each value of the slice is expected to be in the key=value format Values that do not conform to this "spec", will be ignored
func ConvertLabelsToSelector ¶
ConvertLabelsToSelector converts the given labels to selector
func ExtractComponentType ¶ added in v0.0.11
ExtractComponentType returns only component type part from passed component type(default unqualified, fully qualified, versioned, etc...and their combinations) for use as component name Possible types of parameters: 1. "myproject/python:3.5" -- Return python 2. "python:3.5" -- Return python 3. nodejs -- Return nodejs
func GenFileUrl ¶ added in v0.0.11
Converts file path on windows to /C:/path/to/file to work in URL
func GenerateRandomString ¶
GenerateRandomString generates a random string of lower case characters of the given size
func GetDNS1123Name ¶ added in v0.0.15
GetDNS1123Name Converts passed string into DNS-1123 string
func GetRandomName ¶ added in v0.0.15
func GetRandomName(prefix string, prefixMaxLen int, existList []string, retries int) (string, error)
GetRandomName returns a randomly generated name which can be used for naming odo and/or openshift entities prefix: Desired prefix part of the name prefixMaxLen: Desired maximum length of prefix part of random name; if -1 is passed, no limit on length will be enforced existList: List to verify that the returned name does not already exist retries: number of retries to try generating a unique name Returns:
- randomname: is prefix-suffix, where: prefix: string passed as prefix or fetched current directory of length same as the passed prefixMaxLen suffix: 4 char random string
- error: if requested number of retries also failed to generate unique name
func NamespaceOpenShiftObject ¶ added in v0.0.7
Hyphenate applicationName and componentName
func OpenBrowser ¶ added in v0.0.15
OpenBrowser opens the URL within the users default browser
func ParseCreateCmdArgs ¶ added in v0.0.11
parseCreateCmdArgs returns 1. image name 2. component type i.e, builder image name 3. component name default value is component type else the user requested component name 4. component version which is by default latest else version passed with builder image name
func ReadFilePath ¶ added in v0.0.11
Reads file path form URL file:///C:/path/to/file to C:\path\to\file
func SliceDifference ¶ added in v0.0.15
SliceDifference returns the values of s2 that do not exist in s1
func TruncateString ¶ added in v0.0.15
TruncateString truncates passed string to given length Note: if -1 is passed, the original string is returned
Types ¶
This section is empty.