maputils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxDepth = 32
)

Functions

func ConvertInt642String

func ConvertInt642String(data map[string]interface{})

func Diff

func Diff(new, old map[string]interface{}) map[string]Change

func Merge

func Merge(dst, src map[string]interface{}) map[string]interface{}

Merge recursively merges the src and dst maps. Key conflicts are resolved by preferring src, or recursively descending, if both src and dst are maps. borrow code from https://github.com/peterbourgon/mergemap

func MergeOverwriteSlice

func MergeOverwriteSlice(dst, src map[string]interface{}) map[string]interface{}

Types

type Change

type Change struct {
	OldValue   interface{}
	NewValue   interface{}
	ChangeType ChangeType
}

type ChangeType

type ChangeType int
const (
	ADDED ChangeType = iota
	MODIFIED
	DELETED
)

Jump to

Keyboard shortcuts

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