yaml_functions

package
v6.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCaseInsensitiveList

func GetCaseInsensitiveList(m map[string]interface{}, key string) []string

GetCaseInsensitiveList searches for a key in the map (case-insensitively) and returns its value as a []string. Only string elements are included in the returned slice. Returns nil if the key is not found or the value is not a list.

func GetCaseInsensitiveMap

func GetCaseInsensitiveMap(m map[string]interface{}, key string) map[string]interface{}

GetCaseInsensitiveMap searches for a key in the map (case-insensitively) and returns its value as a map[string]interface{}. Returns nil if the key is not found or the value is not a map.

func GetCaseInsensitiveString

func GetCaseInsensitiveString(m map[string]interface{}, key string) string

GetCaseInsensitiveString searches for a key in the map (case-insensitively) and returns its value as a string. It trims whitespace and newlines. Returns an empty string if the key is not found or the value is not a string.

func GetNestedMap

func GetNestedMap(m map[string]interface{}, key string) map[string]interface{}

GetNestedMap is a convenience wrapper that retrieves a nested map for a given key using case-insensitive matching. Returns nil if the key is not found or the value is not a map.

func GetNestedString

func GetNestedString(m map[string]interface{}, key string) string

GetNestedString attempts to retrieve a trimmed string value for the given key from the map. First, it tries to get the string directly using GetCaseInsensitiveString. If not found, it then checks if the key maps to a nested map and returns the first trimmed string value from that map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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