merge

package
v5.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: MIT Imports: 7 Imported by: 4

Documentation

Overview

Package merge provides the capability to merge multiple JSON files or contents into one output.

Merge Rules:

- Simple values (string, number, boolean) are overwritten, others are merged - Elements with same "tag" (or "_tag") in an array will be merged - Add "_priority" property to array elements will help sort the

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyRules

func ApplyRules(m map[string]interface{}) error

ApplyRules applies merge rules according to _tag, _priority fields, and remove them

func FromMap

func FromMap(target map[string]interface{}) ([]byte, error)

FromMap apply merge rules to map and convert it to json

func JSONs

func JSONs(args [][]byte) ([]byte, error)

JSONs merges multiple json contents into one json.

func ToMap

func ToMap(content []byte, target map[string]interface{}) (map[string]interface{}, error)

ToMap merges json content to target map and returns it

Types

This section is empty.

Jump to

Keyboard shortcuts

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