utils

package
v0.0.0-...-0c4b637 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package utils provides utility functions for secrets-sync.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareSecretsJSON

func CompareSecretsJSON(existing, new []byte) (bool, error)

CompareSecretsJSON compares two JSON secret values for equality. Returns true if they are equivalent (handling JSON number differences).

func DeepEqual

func DeepEqual(a, b interface{}) bool

DeepEqual compares two values for deep equality. Handles JSON number comparison properly.

func DeepMerge

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

DeepMerge merges src into dst using the following strategy:

  • Lists: APPEND (src items are appended to dst)
  • Dicts/Maps: MERGE (recursive deep merge)
  • Scalars: OVERRIDE (src replaces dst)
  • Type conflicts: OVERRIDE (src replaces dst)

This matches Python's deepmerge.Merger strategy: list append, dict/map merge, set union, and override fallbacks.

The function modifies dst in place and returns the merged result.

func DeepMergeJSON

func DeepMergeJSON(dst, src []byte) ([]byte, error)

DeepMergeJSON merges two JSON byte slices using deepmerge semantics. Returns the merged result as JSON bytes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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