plainmap

package
v0.0.0-...-a532a67 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: LGPL-3.0 Imports: 5 Imported by: 6

Documentation

Overview

Package plainmap provides primitives for convert types to plainmap. Plain map is one level key map. It contains keys like "lvl1.lvl2".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONToPlainStringMap

func JSONToPlainStringMap(data []byte) (map[string]string, error)

JSONToPlainStringMap conavert json map to a plain map

func Keys

func Keys(plainmap map[string]string, keyPath string) (keys []string)

Keys return sub keys for keyPath

func PlainStringMapToFormattedJSON

func PlainStringMapToFormattedJSON(plainmap map[string]string) (json string, err error)

PlainStringMapToFormattedJSON convert plain map (which all valueas are string) to formatted JSON

func PlainStringMapToJSON

func PlainStringMapToJSON(plainmap map[string]string) (json string, err error)

PlainStringMapToJSON convert plain map (which all valueas are string) to JSON

func RecursiveMapToPlainMap

func RecursiveMapToPlainMap(source map[string]interface{}) (map[string]interface{}, error)

RecursiveMapToPlainMap conavert multi level map to a plain map

func Strain

func Strain(data map[string]string, reg *regexp.Regexp) (result map[string]string, err error)

Strain return map filtred by regexp

func StringMapToRecursiveMap

func StringMapToRecursiveMap(source map[string]string) (out map[string]interface{}, err error)

StringMapToRecursiveMap conavert a plain string map to a multi level tree

func ToRecursiveMap

func ToRecursiveMap(source map[string]interface{}) (out map[string]interface{}, err error)

ToRecursiveMap conavert a plain map to a multi level tree

Types

type Any

type Any interface{}

Any represent any type

Jump to

Keyboard shortcuts

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