Documentation ¶
Overview ¶
Copyright © 2020 The k3d Author(s)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2020 The k3d Author(s)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2020 The k3d Author(s)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- func CreateVersionStr(k3sVersion, k3sChannel string) string
- func ExpandPath(path string) string
- func Find(slice []string, val string) (string, bool)
- func GenerateRandomString(n int) string
- func GerConfigFileName(configFile string, env string) (configFilePath string)
- func GetConfigDirOrCreate() (string, error)
- func GetFreePort() (int, error)
- func GetNodeRole(val string) string
- func ItemExists(arrayType interface{}, item interface{}) bool
- func MapSubexpNames(names, matches []string) map[string]string
- func SplitLabelKeyValue(label string) (string, string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateVersionStr ¶
CreateVersionStr Create install string kubernetesVersion or k3s channel
func Find ¶
Find takes a slice and looks for an element in it. If found it will return it's key, otherwise it will return -1 and a bool of false.
func GenerateRandomString ¶
GenerateRandomString thanks to https://stackoverflow.com/a/31832326/6450189 GenerateRandomString is used to generate a random string that is used as a cluster token
func GerConfigFileName ¶
func GetConfigDirOrCreate ¶
GetConfigDirOrCreate will return the base path of the k3d config directory or create it if it doesn't exist yet k3d's config directory will be $HOME/.k3d (Unix)
func GetFreePort ¶
GetFreePort tries to fetch an open port from the OS-Kernel
func GetNodeRole ¶
func ItemExists ¶
func ItemExists(arrayType interface{}, item interface{}) bool
ItemExists - check if array element exists strArray := [5]string{"India", "Canada", "Japan", "Germany", "Italy"} fmt.Println(itemExists(strArray, "Canada"))
func MapSubexpNames ¶
MapSubexpNames maps regex capturing group names to corresponding matches
func SplitLabelKeyValue ¶
SplitLabelKeyValue separates the label key from the label value (if any)
Types ¶
This section is empty.