conv

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CastAsStringMap

func CastAsStringMap(input map[string]interface{}) (map[string]string, error)

CastAsStringMap takes a map[string]interface{} and down-casts it to a map[string]string asserting that all values are strings.

func InferTypedMap

func InferTypedMap(in map[string]string) map[string]interface{}

InferTypedMap takes a map[string]string and attempts to infer the value types, converting the input to a map[string]interface{}.

func ParseKeyValues

func ParseKeyValues(in []string) (res map[string]string, err error)

ParseKeyValues converts a slice of ["KEY1=VAL1", "KEY2=VAL2", ...] dictionary values into a map[string]string, reporting errors if the input is malformed.

func ToEnvVar

func ToEnvVar(input map[string]string) []v1.EnvVar

func ToOptionsSlice

func ToOptionsSlice(input map[string]string) []string

ToOptionsSlice takes an options map and returns a slice of form ["KEY1=VAL1", "KEY2=VAL2", ...], suitable for Docker commands.

func ToUlimits

func ToUlimits(input []string) ([]*units.Ulimit, error)

ToUlimits converts a slice of strings following the Docker ulimit format, to the appropriate type. If parsing fails, this function shortcircuits and returns an error.

See https://docs.docker.com/engine/reference/commandline/run/#set-ulimits-in-container---ulimit for more info on format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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