yaml

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckEqual added in v1.11.0

func CheckEqual(source, target []byte) (bool, error)

func Merge

func Merge(yamls [][]byte) ([]byte, error)

Merge merges a couple of yaml files into one yaml file, a field in latter file will override the same field in former file.

func MergeAndUnmarshal

func MergeAndUnmarshal(yamls [][]byte) (map[string]interface{}, error)

MergeAndUnmarshal merges a couple of yaml files into one yaml file, and return a map[string]interface{}, a field in latter file will override the same field in former file.

func SearchByPattern

func SearchByPattern(flatMap map[string]interface{}, patterns []map[string]string) ([]map[string]string, error)

SearchByPattern find all matched absolute paths from yaml by the pattern appointed input pattern: []map{name => relative-path} output: app paths found which match the relative-path rule, []{map[name]=>absolute-path} eg: sourceYaml: ---------- yaml begin env: dev svc1:

image:
  repository: go-sample-site
  tag: "0.2.1"

svc2:

image:
  repository: go-sample-site-2
  tag: "0.2.2"

imagePullSecrets:

  • name: default-secret

----------- yaml end pattern: []{"image": "repository", "tag": "tag"} output: []{{"image": "svc1.image.repository", "tag": "svc1.image.tag"}, {"image": "svc2.image.repository", "tag": "svc2.image.tag"}}

Types

This section is empty.

Jump to

Keyboard shortcuts

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