jsong

package
v0.0.0-...-e07d34e Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package jsong implements merging JSON objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(v any, path string) (any, error)

Extract the JSON path from the JSON marshalled any value. Path components comprise elements each seperated by a dot. Path elements may be field names (by the JSON marshaled map key) or array indices for arrays and slices (as a 0-based integers). The definition of the key format is in nuggit.FieldKey.

func Merge

func Merge(dst, src any, dstField, srcField string) (any, error)

Merge the field of the JSON object data with the MergeOptions. It returns the resulting JSON data or any merge errors.

func ValueOf

func ValueOf(v any) (any, error)

ValueOf creates the jsonglom value of the input v. ValueOf performs an operation equivalent to but more efficient than a MarshalJSON followed by an Unmarshal to any.

Types

This section is empty.

Jump to

Keyboard shortcuts

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