pkg

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ANNOTATION_COMPONENT_TITLE string = "compliance-to-policy.component-title"
)

Variables

This section is empty.

Functions

func ChdirFromPkgDirectory

func ChdirFromPkgDirectory(relativePath string) string

func CopyFile

func CopyFile(src string, dest string) error

func GetLogger

func GetLogger(name string) *zap.Logger

func LoadByteToK8sTypedObject

func LoadByteToK8sTypedObject(yamlData []byte, out interface{}) error

func LoadJsonFileToObject

func LoadJsonFileToObject(path string, out interface{}) error

func LoadYaml

func LoadYaml(path string) ([]*unstructured.Unstructured, error)

func LoadYamlFileToK8sTypedObject

func LoadYamlFileToK8sTypedObject(path string, out interface{}) error

func LoadYamlFileToObject

func LoadYamlFileToObject(path string, out interface{}) error

Read a yaml file and invoke yaml.Unmarshal(content, out). Maps and pointers (to a struct, string, int, etc) are accepted as out values.

func MakeDir

func MakeDir(path string) (string, error)

func MakeDirAndWriteObjToYamlFile

func MakeDirAndWriteObjToYamlFile(dir string, filename string, in interface{}) error

func NewFilenameCreator

func NewFilenameCreator(fnameExt string, opts *FilenameCreatorOption) filenameCreator

func PathFromPkgDirectory

func PathFromPkgDirectory(relativePath string) string

func ToK8sTypedObject

func ToK8sTypedObject(unstructured *unstructured.Unstructured, typedObject interface{}) error

func ToK8sUnstructedObject

func ToK8sUnstructedObject(typedObject interface{}) (unstructured.Unstructured, error)

func WriteObjToJsonFile

func WriteObjToJsonFile(path string, in interface{}) error

func WriteObjToYamlFile

func WriteObjToYamlFile(path string, in interface{}) error

func WriteObjToYamlFileByGoYaml

func WriteObjToYamlFileByGoYaml(path string, in interface{}) error

Types

type FilenameCreatorOption

type FilenameCreatorOption struct {
	UnlabelToZero bool
}

type GitUtils

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

func NewGitUtils

func NewGitUtils(tempDir TempDirectory) GitUtils

func (*GitUtils) GitClone

func (g *GitUtils) GitClone(url string) (string, string, error)

func (*GitUtils) LoadFromGit

func (g *GitUtils) LoadFromGit(url string, out interface{}) error

func (*GitUtils) LoadFromWeb

func (g *GitUtils) LoadFromWeb(url string, out interface{}) error

type TempDirectory

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

func NewTempDirectory

func NewTempDirectory(tempDir string) TempDirectory

func (*TempDirectory) GetTempDir

func (t *TempDirectory) GetTempDir() string

Jump to

Keyboard shortcuts

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