config

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const PluginKey = "operatorBuilder"

Variables

View Source
var (
	ErrParseConfig          = errors.New("error parsing workload config")
	ErrParseComponentConfig = errors.New("error parsing workload component config")
	ErrConvertComponent     = errors.New("error converting workload to component workload")
	ErrConvertCollection    = errors.New("error converting workload to collection")
	ErrCollectionRequired   = errors.New("a WorkloadCollection is required when using WorkloadComponents")
	ErrMultipleConfigs      = errors.New("multiple configs found - please provide only one standalone or collection workload")
	ErrMissingWorkload      = errors.New("could not find either standalone or collection workload, please provide one")
	ErrMissingDependencies  = errors.New("missing dependencies - no workload config provided")
)
View Source
var (
	ErrUniqueNames = errors.New("each workload name must be unique")
	ErrUniqueKinds = errors.New("each kind within a group must be unique")
)
View Source
var ErrConfigMustExist = errors.New("no workload config provided - workload config required")

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	WorkloadConfigPath string `json:"workloadConfigPath" yaml:"workloadConfigPath"`
	CliRootCommandName string `json:"cliRootCommandName" yaml:"cliRootCommandName"`
	ControllerImg      string `json:"controllerImg" yaml:"controllerImg"`
}

Plugin contains the project config values which are stored in the PROJECT file under plugins.operatorBuilder.

type Processor

type Processor struct {
	Path string

	// Workload represents the top-level configuration (e.g. as passed in via the --workload-config) flag
	// from the command line, while Children represents subordinate configurations that the parent files such
	// as the componentFiles field.
	Workload kinds.WorkloadBuilder
	Children []*Processor
}

Processor is an object that stores information necessary for generating object source code.

func NewProcessor

func NewProcessor(configPath string) (*Processor, error)

NewProcessor will return a new workload config processor given a path. An error is returned if the workload config does not exist at a path.

func Parse

func Parse(configPath string) (*Processor, error)

Parse will parse and individual workload config given the path at which it exists. It also returns the processor and all of its attributes that were parsed and set during parsing.

func (*Processor) GetProcessors

func (processor *Processor) GetProcessors() []*Processor

GetProcessors gets all of the processors to include the parent and children processors.

func (*Processor) GetWorkloads

func (processor *Processor) GetWorkloads() []kinds.WorkloadBuilder

GetWorkloads gets all of the workloads for a config processor in a flattened fashion.

Jump to

Keyboard shortcuts

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