maps

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 3 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(config map[string]interface{}, key string) (bool, error)

Bool retrieves the interface{} value from the map and returns a boolean.

func ByteArray

func ByteArray(config map[string]interface{}, key string) ([]byte, error)

ByteArray retrieves the interface{} value from the map and returns a byte array.

func Display

func Display(prefix string, Map interface{})

Display displays a map[interface{}]interface{}, map[string]interface{}, []interface{} while also iterating those types within

TODO use constraints

func HexInt

func HexInt(config map[string]interface{}, key string) (int, error)

HexInt retrieves the interface{} value from the map and returns an int.

func Int

func Int(config map[string]interface{}, key string) (int, error)

func IntKeys

func IntKeys(m map[int]interface{}) []int

IntKeys returns all int keys in the given map.

func InterfaceToStringKeys

func InterfaceToStringKeys(m interface{}) (map[string]interface{}, error)

InterfaceToStringKeys converts an interface{} to a map[string]interface{}, returns an error if key is not a string.

func Keys

func Keys(m map[string]interface{}) []string

Keys returns all string keys in the given map.

func Number

func Number(config map[string]interface{}, key string) (float32, error)

Number retrieves the interface{} value from the map and returns a float32.

func SafeInterfaceToStringKeys

func SafeInterfaceToStringKeys(m interface{}) map[string]interface{}

SafeInterfaceToStringKeys converts an interface to map[string]interface{}, if keys are not strings, then the key is converted into a string.

func SafeStringKeys

func SafeStringKeys(m map[interface{}]interface{}) map[string]interface{}

SafeStringKeys converts a map[interface{}]interface{} to a map[string]interface{}, if key is not a string value then key is converted to a string.

func String

func String(config map[string]interface{}, key string) (string, error)

String retrieves interface{} value from map and returns a string value.

func StringArray

func StringArray(config map[string]interface{}, key string) ([]string, error)

StringArray retrieves the interface{} value from the map and returns a string slice.

func ToStringKeys

func ToStringKeys(m map[interface{}]interface{}) (map[string]interface{}, error)

ToStringKeys converts a map[interface{}]interface{} to a map[string]interface{}, returns an error if key is not a string.

func Vector

func Vector(config map[string]interface{}, key string) ([]float32, error)

Vector retrieves a interface{} value from the map and returns a vector.

Types

This section is empty.

Jump to

Keyboard shortcuts

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