Documentation ¶
Index ¶
- Constants
- func GetOptionalInput(msg string) string
- func GetProjectLayout(cfg config.Config) string
- func GetRequiredInput(msg string) string
- func GetStringArray(msg string) []string
- func HasProjectFile() bool
- func ReadConfig() (config.Config, error)
- func RewriteFileContents(filename, target, newContent string) error
- func SetGoVerbose() error
- type ErrUnknownOperatorType
- type InteractiveLevel
- type OperatorType
Constants ¶
const ( // Useful file modes. DirMode = 0755 FileMode = 0644 ExecFileMode = 0755 )
const (
// Go env vars.
GoFlagsEnv = "GOFLAGS"
)
Variables ¶
This section is empty.
Functions ¶
func GetOptionalInput ¶
func GetProjectLayout ¶
GetProjectLayout returns the `layout` field as a comma separated list.
func GetRequiredInput ¶
func GetStringArray ¶
func HasProjectFile ¶
func HasProjectFile() bool
HasProjectFile returns true if the project is configured as a kubebuilder project.
func ReadConfig ¶
ReadConfig returns a configuration if a file containing one exists at the default path (project root).
func RewriteFileContents ¶
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 ¶
func SetGoVerbose() error
SetGoVerbose sets GOFLAGS="${GOFLAGS} -v" if GOFLAGS does not already contain "-v" to make "go" command output verbose.
Types ¶
type ErrUnknownOperatorType ¶
type ErrUnknownOperatorType struct {
Type string
}
func (ErrUnknownOperatorType) Error ¶
func (e ErrUnknownOperatorType) Error() string
type InteractiveLevel ¶
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 ¶
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.