config

package
v0.0.0-...-af24b05 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 178

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadData

func LoadData(data []byte, cfg interface{}) error

func LoadFile

func LoadFile(filename string, cfg interface{}) error

func MergeJSONs

func MergeJSONs(left, right []byte) ([]byte, error)

Unfortunately, if we want to apply a JSON patch to some configuration, we cannot just unmarshal it twice - in that case json.RawMessage objects will be completely replaced, but not merged.

func PatchJSON

func PatchJSON(left []byte, patch map[string]interface{}) ([]byte, error)

Recursively apply a patch to a raw JSON data. Patch is supposed to be a map, which possibly nests other map objects.

func SaveData

func SaveData(cfg interface{}) ([]byte, error)

func SaveFile

func SaveFile(filename string, cfg interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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