Documentation ¶
Overview ¶
Package k8smap provides easy way to bind k8s annotations
Index ¶
- func Bind(annotations map[string]string, s interface{}) (err error)
- func GetAsArrayOfBoolOrFallback(annotations map[string]string, key string, defaultValue []bool) (bools []bool, err error)
- func GetAsArrayOfFloat64OrFallback(annotations map[string]string, key string, defaultValue []float64) (floats []float64, err error)
- func GetAsArrayOfStringsOrFallback(annotations map[string]string, key string, defaultValue []string) []string
- func GetAsBoolOrFallback(annotations map[string]string, key string, defaultValue bool) (val bool, err error)
- func GetAsFloat64OrFallback(annotations map[string]string, key string, defaultValue float64) (float64, error)
- func GetAsStringOrFallback(annotations map[string]string, key, defaultValue string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAsArrayOfBoolOrFallback ¶
func GetAsArrayOfBoolOrFallback(annotations map[string]string, key string, defaultValue []bool) (bools []bool, err error)
GetAsArrayOfBoolOrFallback returns the annotation variable for the given key and falls back to the given defaultValue if not set
func GetAsArrayOfFloat64OrFallback ¶
func GetAsArrayOfFloat64OrFallback(annotations map[string]string, key string, defaultValue []float64) (floats []float64, err error)
GetAsArrayOfFloat64OrFallback returns the annotation variable for the given key and falls back to the given defaultValue if not set
func GetAsArrayOfStringsOrFallback ¶
func GetAsArrayOfStringsOrFallback(annotations map[string]string, key string, defaultValue []string) []string
GetAsArrayOfStringsOrFallback returns the annotation variable for the given key and falls back to the given defaultValue if not set GetAsArrayOfStringsOrFallback trims all whitespaces from input i.e. "us, fr, au" -> {"us","fr","au"}
func GetAsBoolOrFallback ¶
func GetAsBoolOrFallback(annotations map[string]string, key string, defaultValue bool) (val bool, err error)
GetAsBoolOrFallback returns the annotation variable for the given key, parses it as boolean and falls back to the given defaultValue if not set
Types ¶
This section is empty.