utils

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDocument

func ConvertDocument(node *yaml.Node) *yaml.Node

func DefaultNode

func DefaultNode(node *yaml.Node) *yaml.Node

func ExecuteCommand

func ExecuteCommand(name string, args ...string) ([]byte, error)

func ExecuteCommandStdin

func ExecuteCommandStdin(stdin io.Reader, name string, args ...string) ([]byte, error)

func IsDifferent

func IsDifferent(first *yaml.Node, second *yaml.Node) bool

func Loader

func Loader(options LoaderOptions) func(success bool)

func MarshalYaml

func MarshalYaml(node *yaml.Node) ([]byte, error)

func MergeRelativePath

func MergeRelativePath(base, relative string) string

func MergeStrings

func MergeStrings(lines ...string) string

func MergeYaml

func MergeYaml(defaultValues *yaml.Node, chartValues *yaml.Node) *yaml.Node

func NodeIsZero

func NodeIsZero(n *yaml.Node) bool

func OrStr

func OrStr(a, b string) string

func ParseLocalChartYaml

func ParseLocalChartYaml(chart *types.HelmChart) error

func ParseYaml

func ParseYaml(data []byte) (*yaml.Node, error)

func Prompt

func Prompt[T comparable](p PromptMessage[T]) (string, error)

func PruneYaml

func PruneYaml(defaultValues *yaml.Node, chartValues *yaml.Node) *yaml.Node

func ReadFile

func ReadFile(path string) ([]byte, error)

func ReadManifest

func ReadManifest(cwd string) error

func RemoveYamlComments

func RemoveYamlComments(node *yaml.Node) *yaml.Node

func Selector

func Selector(short string, labelLong string, help bool, search bool, options []types.Selectable) int

func Sum256

func Sum256(data []byte) []byte

func ToDocument

func ToDocument(node *yaml.Node) *yaml.Node

func TraverseYamlNode

func TraverseYamlNode(node *yaml.Node, f func(node *yaml.Node))

func WriteManifest

func WriteManifest(cwd string)

Types

type LoaderOptions

type LoaderOptions struct {
	FetchingText string
	SuccessText  string
	FailureText  string
}

type PromptMessage

type PromptMessage[T comparable] struct {
	Label       string
	IsConfirm   bool
	HideEntered bool
	Validate    types.Validator[T]
	Default     string
	Templates   *promptui.PromptTemplates
}

Jump to

Keyboard shortcuts

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