projutil

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Useful file modes.
	DirMode      = 0755
	FileMode     = 0644
	ExecFileMode = 0755
)
View Source
const (
	// Go env vars.
	GoFlagsEnv = "GOFLAGS"
)

Variables

This section is empty.

Functions

func GetOptionalInput added in v0.18.0

func GetOptionalInput(msg string) string

func GetProjectLayout added in v1.3.0

func GetProjectLayout(cfg config.Config) string

GetProjectLayout returns the `layout` field as a comma separated list.

func GetRequiredInput added in v0.18.0

func GetRequiredInput(msg string) string

func GetStringArray added in v0.18.0

func GetStringArray(msg string) []string

func HasProjectFile added in v1.0.0

func HasProjectFile() bool

HasProjectFile returns true if the project is configured as a kubebuilder project.

func ReadConfig added in v1.0.0

func ReadConfig() (config.Config, error)

ReadConfig returns a configuration if a file containing one exists at the default path (project root).

func RewriteFileContents added in v0.18.0

func RewriteFileContents(filename, target, newContent string) error

RewriteFileContents adds newContent to the line after the last occurrence of target in filename's contents, then writes the updated contents back to disk.

func SetGoVerbose added in v0.8.0

func SetGoVerbose() error

SetGoVerbose sets GOFLAGS="${GOFLAGS} -v" if GOFLAGS does not already contain "-v" to make "go" command output verbose.

Types

type ErrUnknownOperatorType added in v0.8.0

type ErrUnknownOperatorType struct {
	Type string
}

func (ErrUnknownOperatorType) Error added in v0.8.0

func (e ErrUnknownOperatorType) Error() string

type InteractiveLevel added in v0.18.0

type InteractiveLevel int

InteractiveLevel captures the user preference on the generation of interactive commands.

const (
	// User has not turned interactive mode on or off, default to off.
	InteractiveSoftOff InteractiveLevel = iota
	// User has explicitly turned interactive mode off.
	InteractiveHardOff
	// User only explicitly turned interactive mode on.
	InteractiveOnAll
)

type OperatorType

type OperatorType = string

OperatorType - the type of operator

const (
	// OperatorTypeGo - golang type of operator.
	OperatorTypeGo OperatorType = "go"
	// OperatorTypeAnsible - ansible type of operator.
	OperatorTypeAnsible OperatorType = "ansible"
	// OperatorTypeHelm - helm type of operator.
	OperatorTypeHelm OperatorType = "helm"

	// OperatorTypeUnknown - unknown type of operator.
	OperatorTypeUnknown OperatorType = "unknown"
)

func PluginChainToOperatorType added in v1.6.0

func PluginChainToOperatorType(pluginKeys []string) OperatorType

PluginChainToOperatorType converts a plugin chain to an operator project type. TODO(estroz): this can probably be made more robust by checking known plugin keys directly.

Jump to

Keyboard shortcuts

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