jsonutil

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package jsonutils converts between a dotted key path ("0x1.c.s.0x6.a.0x0") and its nested map form ({"0x1":{"c":{"s":{"0x6":{"a":{"0x0":<value>}}}}}}). Maps are built directly, not via JSON text, so values keep their exact Go type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitPath

func SplitPath(path string) ([]string, error)

SplitPath splits a dotted path into segments, erroring on an empty path or segment. The single source of truth for path validity.

func ToJson

func ToJson(path string, value interface{}) (map[string]interface{}, error)

ToJson expands a dotted path and leaf value into a nested map, one nesting key per segment.

func ToPath

func ToPath(nested map[string]interface{}) map[string]interface{}

ToPath flattens a nested map into dotted-path keys, the inverse of ToJson. An empty map is kept as a leaf.

Types

This section is empty.

Jump to

Keyboard shortcuts

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