maps

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyKeys

func AnyKeys[V interface{}](data map[interface{}]V) (keys []interface{})

func CamelizeKeys

func CamelizeKeys[V interface{}](data map[string]V) (camelized map[string]V)

func DebugWalk

func DebugWalk(thing map[string]interface{}) (results string)

func ExtractBoolValue

func ExtractBoolValue(v interface{}) (b bool)

func ExtractEnumValue

func ExtractEnumValue(key string, upper bool, enums []string, data map[string]interface{}) (value string, err error)

func ExtractIntValue

func ExtractIntValue(key string, data map[string]interface{}) (value int, err error)

func FinalizeNjnFieldAttributes

func FinalizeNjnFieldAttributes(attrs map[string]interface{}) (attributes []template.HTMLAttr, err error)

func FinalizeNjnFieldData

func FinalizeNjnFieldData(data map[string]interface{}, field map[string]interface{}, skip ...string) (err error)

func Get

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

func IsMap

func IsMap(v interface{}) (ok bool)

func KebabKeys

func KebabKeys[V interface{}](data map[string]V) (kebabed map[string]V)

func Keys

func Keys[V interface{}](data map[string]V) (keys []string)

func ParseKeyIntValue

func ParseKeyIntValue(key string, data map[string]interface{}) (v int, ok bool)

func ParseNjnFieldAttributes

func ParseNjnFieldAttributes(field map[string]interface{}) (attributes map[string]interface{}, classes []string, styles map[string]string, err error)

func ReverseSortedKeys

func ReverseSortedKeys[V interface{}](data map[string]V) (keys []string)

func ReverseSortedNumbers

func ReverseSortedNumbers[K Number, V interface{}](data map[K]V) (keys []K)

func SortedKeyLengths

func SortedKeyLengths[V interface{}](data map[string]V) (keys []string)

SortedKeyLengths returns the list of keys natural sorted and from longest to shortest

func SortedKeys

func SortedKeys[V interface{}](data map[string]V) (keys []string)

func SortedKeysByLastKeyword

func SortedKeysByLastKeyword[V interface{}](data map[string]V) (keys []string)

func SortedKeysByLastName

func SortedKeysByLastName[V interface{}](data map[string]V) (keys []string)

func SortedNumbers

func SortedNumbers[K Number, V interface{}](data map[K]V) (keys []K)

func TransformAnyToStringSlice

func TransformAnyToStringSlice(input interface{}) (output []string, ok bool)

func TransformMapAnyToString

func TransformMapAnyToString(input map[string]interface{}) (output map[string]string)

func ValuesSortedByKeys

func ValuesSortedByKeys[V interface{}](data map[string]V) (values []V)

Types

type Number

type Number interface {
	int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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