maps

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 SafeInterfaceToString

func SafeInterfaceToString[V any](m interface{}) map[string]V

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 TryString

func TryString(config map[string]interface{}, key string) 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