util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BreakingChangeAllowed

func BreakingChangeAllowed(left string, right string) (bool, error)

func CompareVersions

func CompareVersions(left string, right string) (int, error)

func FileExists

func FileExists(file string) bool

func Flatten

func Flatten(items []interface{}) ([]string, error)

func GetRandomPort

func GetRandomPort() (int, error)

func GithubGroupsBegin

func GithubGroupsBegin(w io.Writer, title string)

func GithubGroupsEnd

func GithubGroupsEnd(w io.Writer)

func PrintDelimiterLineToWriter

func PrintDelimiterLineToWriter(w io.Writer, delimiterChar string)

func RandomString

func RandomString(length int) string

RandomString string creates a random string of numbers and lower-case ascii characters with the specified length.

func SanitizeName

func SanitizeName(s string, maxLength int) string

func StringSliceContains

func StringSliceContains(slice []string, s string) bool

Types

type ChartYaml

type ChartYaml struct {
	Name        string `yaml:"name"`
	Version     string `yaml:"version"`
	Deprecated  bool   `yaml:"deprecated"`
	Maintainers []Maintainer
}

func ReadChartYaml

func ReadChartYaml(dir string) (*ChartYaml, error)

ReadChartYaml attempts to parse Chart.yaml within the specified directory and return a newly allocated ChartYaml object. If no Chart.yaml is present or there is an error unmarshaling the file contents, an error will be returned.

func UnmarshalChartYaml

func UnmarshalChartYaml(yamlBytes []byte) (*ChartYaml, error)

UnmarshalChartYaml parses the yaml encoded data and returns a newly allocated ChartYaml object.

type DirectoryLister

type DirectoryLister struct{}

func (DirectoryLister) ListChildDirs

func (l DirectoryLister) ListChildDirs(parentDir string, test func(dir string) bool) ([]string, error)

ListChildDirs lists subdirectories of parentDir matching the test function.

type Maintainer

type Maintainer struct {
	Name  string `yaml:"name"`
	Email string `yaml:"email"`
}

type Utils

type Utils struct{}

func (Utils) LookupChartDir

func (u Utils) LookupChartDir(chartDirs []string, dir string) (string, error)

type ZarfChart

type ZarfChart struct {
	Name        string              `yaml:"name"`
	Version     string              `yaml:"version,omitempty"`
	Url         string              `yaml:"url,omitempty"`
	RepoName    string              `yaml:"repoName,omitempty"`
	GitPath     string              `yaml:"gitPath,omitempty"`
	LocalPath   string              `yaml:"localPath,omitempty"`
	Namespace   string              `yaml:"namespace,omitempty"`
	ReleaseName string              `yaml:"releaseName,omitempty"`
	NoWait      bool                `yaml:"noWait,omitempty"`
	ValuesFiles []string            `yaml:"valuesFiles,omitempty"`
	Variables   []ZarfChartVariable `yaml:"variables,omitempty"`
}

type ZarfChartVariable

type ZarfChartVariable struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description,omitempty"`
	Path        string `yaml:"path"`
}

type ZarfComponent

type ZarfComponent struct {
	Name           string               `yaml:"name"`
	Description    string               `yaml:"description,omitempty"`
	Default        bool                 `yaml:"default,omitempty"`
	Required       bool                 `yaml:"required,omitempty"`
	Only           ZarfComponentOnly    `yaml:"only,omitempty"`
	Group          string               `yaml:"group,omitempty"`
	DepsWith       []string             `yaml:"depsWith,omitempty"`
	Files          []ZarfFile           `yaml:"files,omitempty"`
	Charts         []ZarfChart          `yaml:"charts,omitempty"`
	Manifests      []ZarfManifest       `yaml:"manifests,omitempty"`
	Images         []string             `yaml:"images,omitempty"`
	Repos          []string             `yaml:"repos,omitempty"`
	DataInjections []ZarfDataInjection  `yaml:"dataInjections,omitempty"`
	Scripts        ZarfComponentScripts `yaml:"scripts,omitempty"`
}

type ZarfComponentOnly

type ZarfComponentOnly struct {
	LocalOS string                   `yaml:"localOS,omitempty"`
	Cluster ZarfComponentOnlyCluster `yaml:"cluster,omitempty"`
}

type ZarfComponentOnlyCluster

type ZarfComponentOnlyCluster struct {
	Architecture string   `yaml:"architecture,omitempty"`
	Distros      []string `yaml:"distros,omitempty"`
}

type ZarfComponentScripts

type ZarfComponentScripts struct {
	ShowOutput     bool     `yaml:"showOutput,omitempty"`
	TimeoutSeconds int      `yaml:"timeoutSeconds,omitempty"`
	Retry          bool     `yaml:"retry,omitempty"`
	Prepare        []string `yaml:"prepare,omitempty"`
	Before         []string `yaml:"before,omitempty"`
	After          []string `yaml:"after,omitempty"`
}

type ZarfConstant

type ZarfConstant struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

type ZarfContainerTarget

type ZarfContainerTarget struct {
	Namespace string `yaml:"namespace"`
	Selector  string `yaml:"selector"`
	Container string `yaml:"container"`
	Path      string `yaml:"path"`
}

type ZarfDataInjection

type ZarfDataInjection struct {
	Source   string              `yaml:"source"`
	Target   ZarfContainerTarget `yaml:"target"`
	Compress bool                `yaml:"compress,omitempty"`
}

type ZarfFile

type ZarfFile struct {
	Source      string `yaml:"source"`
	Target      string `yaml:"target"`
	Shasum      string `yaml:"shasum,omitempty"`
	Executable  bool   `yaml:"executable,omitempty"`
	ExtractPath string `yaml:"extractPath,omitempty"`
}

type ZarfManifest

type ZarfManifest struct {
	Name                string   `yaml:"name"`
	Namespace           string   `yaml:"namespace,omitempty"`
	Files               []string `yaml:"files,omitempty"`
	KustomizeAllowAnyOf []string `yaml:"kustomizeAllowAnyOf,omitempty"`
	Kustomizations      []string `yaml:"kustomizations,omitempty"`
}

type ZarfVariable

type ZarfVariable struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description,omitempty"`
	Default     string `yaml:"default,omitempty"`
	Prompt      bool   `yaml:"prompt,omitempty"`
}

type ZarfYaml

type ZarfYaml struct {
	Kind     string `yaml:"kind"`
	Metadata struct {
		Name         string `yaml:"name"`
		Description  string `yaml:"description"`
		Version      string `yaml:"version"`
		Architecture string `yaml:"architecture,omitempty"`
		Deprecated   bool   `yaml:"deprecated,omitempty"`
	} `yaml:"metadata"`
	Variables  []ZarfVariable  `yaml:"variables,omitempty"`
	Constants  []ZarfConstant  `yaml:"constants,omitempty"`
	Components []ZarfComponent `yaml:"components,omitempty"`
}

func ReadZarfYaml

func ReadZarfYaml(path string) (*ZarfYaml, error)

ReadZarfYaml attempts to parse zarf.yaml within the specified directory and return a newly allocated ZarfYaml object. If no zarf.yaml is present or there is an error unmarshaling the file contents, an error will be returned.

func UnmarshalZarfYaml

func UnmarshalZarfYaml(yamlBytes []byte) (*ZarfYaml, error)

UnmarshalZarfYaml parses the yaml encoded data and returns a newly allocated ZarfYaml object.

Jump to

Keyboard shortcuts

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