normalize

package
v0.0.0-...-c5ff7ba Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: PostgreSQL Imports: 3 Imported by: 0

Documentation

Overview

Package normalize sanitizes loose YAML input.

For use by higher level normalization functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alias

func Alias(yaml map[string]any, key, alias string) (err error)

Alias rename a key in a map.

Returns an error if alias and key already co-exists.

func Boolean

func Boolean(v any) any

Boolean sanitizes for mapstructure.

Returns "true" or "false" for common boolean values. Unknown values are returned as is for mapstructure validation.

func List

func List(yaml any) (list []any)

List ensure yaml is a list.

Wraps scalar or map in a list. Returns list as is.

func SpuriousKeys

func SpuriousKeys(yaml map[string]any, knownKeys ...string) error

SpuriousKeys checks for unknown keys in a YAML map.

func StringList

func StringList(yaml any) (list []string, err error)

StringList ensure yaml is a list of string.

Like List, but enforce string type for items.

Types

This section is empty.

Jump to

Keyboard shortcuts

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