k8smap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package k8smap provides easy way to bind k8s annotations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(annotations map[string]string, s interface{}) (err error)

Bind binds environment variables into structure

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

func GetAsFloat64OrFallback

func GetAsFloat64OrFallback(annotations map[string]string, key string, defaultValue float64) (float64, error)

GetAsFloat64OrFallback returns the annotation variable (parsed as float64) for the given key and falls back to the given defaultValue if not set

func GetAsStringOrFallback

func GetAsStringOrFallback(annotations map[string]string, key, defaultValue string) string

GetAsStringOrFallback returns the annotation variable for the given key and falls back to the given defaultValue if not set

Types

This section is empty.

Jump to

Keyboard shortcuts

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