config

package
Version: v0.0.0-...-e080de1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 6 Imported by: 83

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.

Source Files

Jump to

Keyboard shortcuts

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