util

package
v0.0.0-...-1bf1170 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdExec

func CmdExec(baseCmd string, args ...string) (string, error)

func ConcatenateYAMLs

func ConcatenateYAMLs(yamls [][]byte) []byte

func ExactMatch

func ExactMatch(pattern, value string) bool

func ExactMatchWithPatternArray

func ExactMatchWithPatternArray(value string, patternArray []string) bool

func FindSingleYaml

func FindSingleYaml(concatYamlBytes []byte, apiVersion, kind, name, namespace string) (bool, []byte)

func FindYAMLsInDir

func FindYAMLsInDir(dirPath string) ([][]byte, error)

func GenerateConcatYAMLsFromImage

func GenerateConcatYAMLsFromImage(img v1.Image) ([]byte, error)

func GetAnnotationsInYAML

func GetAnnotationsInYAML(yamlBytes []byte) map[string]string

func GetBlob

func GetBlob(layer v1.Layer) ([]byte, error)

func GetNameInfoFromCert

func GetNameInfoFromCert(cert *x509.Certificate) string

TODO: support other attributes

func GetUnionOfArrays

func GetUnionOfArrays(array1, array2 []string) []string

func MatchBigInt

func MatchBigInt(pattern string, value *big.Int) bool

func MatchPattern

func MatchPattern(pattern, value string) bool

func MatchPatternWithArray

func MatchPatternWithArray(pattern string, valueArray []string) bool

func MatchSinglePattern

func MatchSinglePattern(pattern, value string) bool

func MatchWithPatternArray

func MatchWithPatternArray(value string, patternArray []string) bool

func PullImage

func PullImage(imageRef string) (v1.Image, error)

func SplitConcatYAMLs

func SplitConcatYAMLs(yaml []byte) [][]byte

func SplitRule

func SplitRule(rules string) []string

func TarGzCompress

func TarGzCompress(src string, buf io.Writer) error

func TarGzDecompress

func TarGzDecompress(src io.Reader, dst string) error

Types

type ResourceInfo

type ResourceInfo struct {
	// contains filtered or unexported fields
}

func (ResourceInfo) Map

func (ri ResourceInfo) Map() map[string]string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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