utils

package
v0.0.0-...-20989ac Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeJSON

func MergeJSON(message json.RawMessage, overrides map[string]interface{}) (json.RawMessage, error)

MergeJSON adds (or overrides if such keys exist) key/value data from `overrides` map into the `message` json.RawMessage and returns merged json data

func MergeMaps

func MergeMaps(originalMap, override map[string]interface{}) (map[string]interface{}, error)

MergeMaps takes two maps with any value and merges it recursively. if the underlying value is also a map[string]interface{} it will replace only the values in that map but if the value is any other format, it will replace it with the override value

func MergeTwoYamls

func MergeTwoYamls(originalYAMLFile string, overrideYAMLFile *string) ([]byte, error)

MergeTwoYamls reads the original yaml file and overrides the original file with the override file. This overriding will follow the rules in MergeMaps.

func WriteYAMLFile

func WriteYAMLFile(b []byte, path string) error

WriteYAMLFile takes a byte slice and writes to the path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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