Documentation
¶
Index ¶
- Constants
- Variables
- func CloseFile(file io.ReadCloser)
- func Glob(pattern string) ([]string, error)
- func InitializeMarkerInspector(markerTypes ...MarkerType) (*inspect.Inspector, error)
- func ReadStream(fileName string) (io.ReadCloser, error)
- func TransformYAML(results ...*inspect.YAMLResult) error
- type APIFields
- type ChildResource
- type CliCommand
- type CollectionFieldMarker
- type ComponentWorkload
- func (c *ComponentWorkload) GetAPIGroup() string
- func (c *ComponentWorkload) GetAPIKind() string
- func (c *ComponentWorkload) GetAPISpecFields() *APIFields
- func (c *ComponentWorkload) GetAPIVersion() string
- func (c *ComponentWorkload) GetCollection() *WorkloadCollection
- func (c *ComponentWorkload) GetComponentResource(domain, repo string, clusterScoped bool) *resource.Resource
- func (*ComponentWorkload) GetComponents() []*ComponentWorkload
- func (c *ComponentWorkload) GetDependencies() []*ComponentWorkload
- func (c *ComponentWorkload) GetDomain() string
- func (c *ComponentWorkload) GetFuncNames() (createFuncNames, initFuncNames []string)
- func (c *ComponentWorkload) GetName() string
- func (c *ComponentWorkload) GetOwnershipRules() *[]OwnershipRule
- func (c *ComponentWorkload) GetPackageName() string
- func (c *ComponentWorkload) GetRBACRules() *[]RBACRule
- func (c *ComponentWorkload) GetRootCommand() *CliCommand
- func (c *ComponentWorkload) GetSourceFiles() *[]SourceFile
- func (c *ComponentWorkload) GetSubCommand() *CliCommand
- func (c *ComponentWorkload) GetWorkloadKind() WorkloadKind
- func (c *ComponentWorkload) HasChildResources() bool
- func (c *ComponentWorkload) HasSubCmdDescription() bool
- func (c *ComponentWorkload) HasSubCmdName() bool
- func (c *ComponentWorkload) IsClusterScoped() bool
- func (*ComponentWorkload) IsCollection() bool
- func (*ComponentWorkload) IsComponent() bool
- func (*ComponentWorkload) IsStandalone() bool
- func (c *ComponentWorkload) LoadManifests(workloadPath string) error
- func (*ComponentWorkload) SetComponents(components []*ComponentWorkload) error
- func (c *ComponentWorkload) SetNames()
- func (c *ComponentWorkload) SetResources(workloadPath string) error
- func (c *ComponentWorkload) Validate() error
- type ComponentWorkloadSpec
- type FieldMarker
- type FieldType
- type MarkerType
- type OwnershipRule
- type OwnershipRules
- type PluginConfig
- type RBACRule
- type RBACRules
- type Resource
- type SourceFile
- type StandaloneWorkload
- func (s *StandaloneWorkload) GetAPIGroup() string
- func (s *StandaloneWorkload) GetAPIKind() string
- func (s *StandaloneWorkload) GetAPISpecFields() *APIFields
- func (s *StandaloneWorkload) GetAPIVersion() string
- func (s *StandaloneWorkload) GetCollection() *WorkloadCollection
- func (*StandaloneWorkload) GetComponentResource(domain, repo string, clusterScoped bool) *resource.Resource
- func (s *StandaloneWorkload) GetComponents() []*ComponentWorkload
- func (*StandaloneWorkload) GetDependencies() []*ComponentWorkload
- func (s *StandaloneWorkload) GetDomain() string
- func (s *StandaloneWorkload) GetFuncNames() (createFuncNames, initFuncNames []string)
- func (s *StandaloneWorkload) GetName() string
- func (s *StandaloneWorkload) GetOwnershipRules() *[]OwnershipRule
- func (s *StandaloneWorkload) GetPackageName() string
- func (s *StandaloneWorkload) GetRBACRules() *[]RBACRule
- func (s *StandaloneWorkload) GetRootCommand() *CliCommand
- func (s *StandaloneWorkload) GetSourceFiles() *[]SourceFile
- func (s *StandaloneWorkload) GetSubCommand() *CliCommand
- func (s *StandaloneWorkload) GetWorkloadKind() WorkloadKind
- func (s *StandaloneWorkload) HasChildResources() bool
- func (s *StandaloneWorkload) HasRootCmdDescription() bool
- func (s *StandaloneWorkload) HasRootCmdName() bool
- func (*StandaloneWorkload) HasSubCmdName() bool
- func (s *StandaloneWorkload) IsClusterScoped() bool
- func (*StandaloneWorkload) IsCollection() bool
- func (*StandaloneWorkload) IsComponent() bool
- func (*StandaloneWorkload) IsStandalone() bool
- func (s *StandaloneWorkload) LoadManifests(workloadPath string) error
- func (*StandaloneWorkload) SetComponents(components []*ComponentWorkload) error
- func (s *StandaloneWorkload) SetNames()
- func (s *StandaloneWorkload) SetResources(workloadPath string) error
- func (s *StandaloneWorkload) Validate() error
- type StandaloneWorkloadSpec
- type WorkloadAPIBuilder
- type WorkloadAPISpec
- type WorkloadCollection
- func (c *WorkloadCollection) GetAPIGroup() string
- func (c *WorkloadCollection) GetAPIKind() string
- func (c *WorkloadCollection) GetAPISpecFields() *APIFields
- func (c *WorkloadCollection) GetAPIVersion() string
- func (c *WorkloadCollection) GetCollection() *WorkloadCollection
- func (c *WorkloadCollection) GetComponentResource(domain, repo string, clusterScoped bool) *resource.Resource
- func (c *WorkloadCollection) GetComponents() []*ComponentWorkload
- func (c *WorkloadCollection) GetDependencies() []*ComponentWorkload
- func (c *WorkloadCollection) GetDomain() string
- func (c *WorkloadCollection) GetFuncNames() (createFuncNames, initFuncNames []string)
- func (c *WorkloadCollection) GetName() string
- func (*WorkloadCollection) GetOwnershipRules() *[]OwnershipRule
- func (c *WorkloadCollection) GetPackageName() string
- func (c *WorkloadCollection) GetRBACRules() *[]RBACRule
- func (c *WorkloadCollection) GetRootCommand() *CliCommand
- func (c *WorkloadCollection) GetSourceFiles() *[]SourceFile
- func (c *WorkloadCollection) GetSubCommand() *CliCommand
- func (c *WorkloadCollection) GetWorkloadKind() WorkloadKind
- func (c *WorkloadCollection) HasChildResources() bool
- func (c *WorkloadCollection) HasRootCmdDescription() bool
- func (c *WorkloadCollection) HasRootCmdName() bool
- func (c *WorkloadCollection) HasSubCmdDescription() bool
- func (c *WorkloadCollection) HasSubCmdName() bool
- func (c *WorkloadCollection) IsClusterScoped() bool
- func (c *WorkloadCollection) IsCollection() bool
- func (c *WorkloadCollection) IsComponent() bool
- func (c *WorkloadCollection) IsStandalone() bool
- func (c *WorkloadCollection) LoadManifests(workloadPath string) error
- func (c *WorkloadCollection) SetComponents(components []*ComponentWorkload) error
- func (c *WorkloadCollection) SetNames()
- func (c *WorkloadCollection) SetResources(workloadPath string) error
- func (c *WorkloadCollection) Validate() error
- type WorkloadCollectionSpec
- type WorkloadIdentifier
- type WorkloadInitializer
- type WorkloadKind
- type WorkloadShared
- type WorkloadSpec
Constants ¶
const PluginConfigKey = "operatorBuilder"
Variables ¶
var ( ErrNamesMustBeUnique = errors.New("each workload name must be unique") ErrConfigMustExist = errors.New("no workload config provided - workload config required") ErrMultipleConfigs = errors.New("multiple configs found - please provide only one standalone or collection workload") ErrCollectionRequired = errors.New("a WorkloadCollection is required when using WorkloadComponents") ErrMissingWorkload = errors.New("could not find either standalone or collection workload, please provide one") ErrMissingDependencies = errors.New("missing dependencies - no workload config provided") )
var ErrInvalidKind = errors.New("unrecognized workload kind in workload config")
var ErrMissingRequiredFields = errors.New("missing required fields")
var ErrNoComponentsOnComponent = errors.New("cannot set component workloads on a component workload - only on collections")
var ErrNoComponentsOnStandalone = errors.New("cannot set component workloads on a component workload - only on collections")
var ErrOverwriteExistingValue = errors.New("an attempt to overwrite existing value was made")
var ErrUnableToParseFieldType = errors.New("unable to parse field")
Functions ¶
func Glob ¶ added in v0.5.0
Glob adds double-star support to the core path/filepath Glob function. It's useful when your globs might have double-stars, but you're not sure.
func InitializeMarkerInspector ¶
func InitializeMarkerInspector(markerTypes ...MarkerType) (*inspect.Inspector, error)
func ReadStream ¶
func ReadStream(fileName string) (io.ReadCloser, error)
func TransformYAML ¶
func TransformYAML(results ...*inspect.YAMLResult) error
Types ¶
type APIFields ¶ added in v0.4.0
type APIFields struct { Name string StructName string Type FieldType Tags string Comments []string Markers []string Children []*APIFields Default string Sample string // contains filtered or unexported fields }
func (*APIFields) GenerateAPISpec ¶ added in v0.4.0
func (*APIFields) GenerateSampleSpec ¶ added in v0.4.0
type ChildResource ¶
type ChildResource struct { Name string UniqueName string Group string Version string Kind string StaticContent string SourceCode string }
ChildResource contains attributes for resources created by the custom resource. These definitions are inferred from the resource manifests.
type CliCommand ¶
type CliCommand struct { Name string Description string VarName string FileName string SubCommands *[]CliCommand }
CliCommand defines the command name and description for the root command or subcommand of a companion CLI.
func (*CliCommand) GetSubCmdRelativeFileName ¶ added in v0.5.0
func (cli *CliCommand) GetSubCmdRelativeFileName( rootCmdName string, subCommandFolder string, group string, fileName string, ) string
GetSubCmdRelativeFileName will generate a path for a subcommand CLI file that is relative to the root of the repository.
type CollectionFieldMarker ¶
type CollectionFieldMarker FieldMarker
func (CollectionFieldMarker) String ¶ added in v0.4.0
func (cfm CollectionFieldMarker) String() string
type ComponentWorkload ¶
type ComponentWorkload struct { Spec ComponentWorkloadSpec `json:"spec" yaml:"spec" validate:"required"` }
ComponentWorkload defines a workload that is a component of a collection.
func (*ComponentWorkload) GetAPIGroup ¶
func (c *ComponentWorkload) GetAPIGroup() string
func (*ComponentWorkload) GetAPIKind ¶
func (c *ComponentWorkload) GetAPIKind() string
func (*ComponentWorkload) GetAPISpecFields ¶
func (c *ComponentWorkload) GetAPISpecFields() *APIFields
func (*ComponentWorkload) GetAPIVersion ¶
func (c *ComponentWorkload) GetAPIVersion() string
func (*ComponentWorkload) GetCollection ¶ added in v0.5.0
func (c *ComponentWorkload) GetCollection() *WorkloadCollection
func (*ComponentWorkload) GetComponentResource ¶
func (c *ComponentWorkload) GetComponentResource(domain, repo string, clusterScoped bool) *resource.Resource
func (*ComponentWorkload) GetComponents ¶
func (*ComponentWorkload) GetComponents() []*ComponentWorkload
func (*ComponentWorkload) GetDependencies ¶
func (c *ComponentWorkload) GetDependencies() []*ComponentWorkload
func (*ComponentWorkload) GetDomain ¶ added in v0.3.0
func (c *ComponentWorkload) GetDomain() string
methods that implement WorkloadAPIBuilder.
func (*ComponentWorkload) GetFuncNames ¶
func (c *ComponentWorkload) GetFuncNames() (createFuncNames, initFuncNames []string)
func (*ComponentWorkload) GetName ¶
func (c *ComponentWorkload) GetName() string
func (*ComponentWorkload) GetOwnershipRules ¶
func (c *ComponentWorkload) GetOwnershipRules() *[]OwnershipRule
func (*ComponentWorkload) GetPackageName ¶
func (c *ComponentWorkload) GetPackageName() string
func (*ComponentWorkload) GetRBACRules ¶
func (c *ComponentWorkload) GetRBACRules() *[]RBACRule
func (*ComponentWorkload) GetRootCommand ¶ added in v0.5.0
func (c *ComponentWorkload) GetRootCommand() *CliCommand
func (*ComponentWorkload) GetSourceFiles ¶
func (c *ComponentWorkload) GetSourceFiles() *[]SourceFile
func (*ComponentWorkload) GetSubCommand ¶ added in v0.5.0
func (c *ComponentWorkload) GetSubCommand() *CliCommand
func (*ComponentWorkload) GetWorkloadKind ¶
func (c *ComponentWorkload) GetWorkloadKind() WorkloadKind
func (*ComponentWorkload) HasChildResources ¶
func (c *ComponentWorkload) HasChildResources() bool
func (*ComponentWorkload) HasSubCmdDescription ¶ added in v0.3.0
func (c *ComponentWorkload) HasSubCmdDescription() bool
func (*ComponentWorkload) HasSubCmdName ¶
func (c *ComponentWorkload) HasSubCmdName() bool
func (*ComponentWorkload) IsClusterScoped ¶
func (c *ComponentWorkload) IsClusterScoped() bool
func (*ComponentWorkload) IsCollection ¶
func (*ComponentWorkload) IsCollection() bool
func (*ComponentWorkload) IsComponent ¶
func (*ComponentWorkload) IsComponent() bool
func (*ComponentWorkload) IsStandalone ¶
func (*ComponentWorkload) IsStandalone() bool
func (*ComponentWorkload) LoadManifests ¶ added in v0.4.0
func (c *ComponentWorkload) LoadManifests(workloadPath string) error
func (*ComponentWorkload) SetComponents ¶
func (*ComponentWorkload) SetComponents(components []*ComponentWorkload) error
func (*ComponentWorkload) SetNames ¶
func (c *ComponentWorkload) SetNames()
func (*ComponentWorkload) SetResources ¶
func (c *ComponentWorkload) SetResources(workloadPath string) error
func (*ComponentWorkload) Validate ¶
func (c *ComponentWorkload) Validate() error
type ComponentWorkloadSpec ¶
type ComponentWorkloadSpec struct { API WorkloadAPISpec `json:"api" yaml:"api"` CompanionCliSubcmd CliCommand `json:"companionCliSubcmd" yaml:"companionCliSubcmd" validate:"omitempty"` CompanionCliRootcmd CliCommand Dependencies []string `json:"dependencies" yaml:"dependencies"` ConfigPath string ComponentDependencies []*ComponentWorkload WorkloadSpec `yaml:",inline"` }
ComponentWorkloadSpec defines the attributes for a workload that is a component of a collection.
type FieldMarker ¶
type FieldMarker struct { Name string Type FieldType Description *string Default interface{} `marker:",optional"` Replace *string // contains filtered or unexported fields }
func (FieldMarker) String ¶
func (fm FieldMarker) String() string
type MarkerType ¶ added in v0.4.0
type MarkerType int
const ( FieldMarkerType MarkerType = iota CollectionMarkerType )
type OwnershipRule ¶
OwnershipRule contains the info needed to create the controller ownership functionality when setting up the controller with the manager. This allows the controller to reconcile the state of a deleted resource that it manages.
type OwnershipRules ¶ added in v0.4.0
type OwnershipRules []OwnershipRule
type PluginConfig ¶
type PluginConfig struct { WorkloadConfigPath string `json:"workloadConfigPath" yaml:"workloadConfigPath"` CliRootCommandName string `json:"cliRootCommandName" yaml:"cliRootCommandName"` }
PluginConfig contains the project config values which are stored in the PROJECT file under plugins.operatorBuilder.
type RBACRule ¶
RBACRule contains the info needed to create the kubebuilder:rbac markers in the controller.
type RBACRules ¶ added in v0.4.0
type RBACRules []RBACRule
func (*RBACRules) AddOrUpdateRules ¶ added in v0.4.0
type Resource ¶ added in v0.4.0
Resource represents a single input manifest for a given config.
func (*Resource) UnmarshalYAML ¶ added in v0.4.0
type SourceFile ¶
type SourceFile struct { Filename string Children []ChildResource HasStatic bool }
SourceFile represents a golang source code file that contains one or more child resource objects.
type StandaloneWorkload ¶
type StandaloneWorkload struct { Spec StandaloneWorkloadSpec `json:"spec" yaml:"spec" validate:"required"` }
StandaloneWorkload defines a standalone workload.
func (*StandaloneWorkload) GetAPIGroup ¶
func (s *StandaloneWorkload) GetAPIGroup() string
func (*StandaloneWorkload) GetAPIKind ¶
func (s *StandaloneWorkload) GetAPIKind() string
func (*StandaloneWorkload) GetAPISpecFields ¶
func (s *StandaloneWorkload) GetAPISpecFields() *APIFields
func (*StandaloneWorkload) GetAPIVersion ¶
func (s *StandaloneWorkload) GetAPIVersion() string
func (*StandaloneWorkload) GetCollection ¶ added in v0.5.0
func (s *StandaloneWorkload) GetCollection() *WorkloadCollection
func (*StandaloneWorkload) GetComponentResource ¶
func (*StandaloneWorkload) GetComponentResource(domain, repo string, clusterScoped bool) *resource.Resource
func (*StandaloneWorkload) GetComponents ¶
func (s *StandaloneWorkload) GetComponents() []*ComponentWorkload
func (*StandaloneWorkload) GetDependencies ¶
func (*StandaloneWorkload) GetDependencies() []*ComponentWorkload
func (*StandaloneWorkload) GetDomain ¶
func (s *StandaloneWorkload) GetDomain() string
methods that implement WorkloadInitializer.
func (*StandaloneWorkload) GetFuncNames ¶
func (s *StandaloneWorkload) GetFuncNames() (createFuncNames, initFuncNames []string)
func (*StandaloneWorkload) GetName ¶
func (s *StandaloneWorkload) GetName() string
methods that implement WorkloadAPIBuilder.
func (*StandaloneWorkload) GetOwnershipRules ¶
func (s *StandaloneWorkload) GetOwnershipRules() *[]OwnershipRule
func (*StandaloneWorkload) GetPackageName ¶
func (s *StandaloneWorkload) GetPackageName() string
func (*StandaloneWorkload) GetRBACRules ¶
func (s *StandaloneWorkload) GetRBACRules() *[]RBACRule
func (*StandaloneWorkload) GetRootCommand ¶ added in v0.5.0
func (s *StandaloneWorkload) GetRootCommand() *CliCommand
func (*StandaloneWorkload) GetSourceFiles ¶
func (s *StandaloneWorkload) GetSourceFiles() *[]SourceFile
func (*StandaloneWorkload) GetSubCommand ¶ added in v0.5.0
func (s *StandaloneWorkload) GetSubCommand() *CliCommand
func (*StandaloneWorkload) GetWorkloadKind ¶
func (s *StandaloneWorkload) GetWorkloadKind() WorkloadKind
func (*StandaloneWorkload) HasChildResources ¶
func (s *StandaloneWorkload) HasChildResources() bool
func (*StandaloneWorkload) HasRootCmdDescription ¶ added in v0.3.0
func (s *StandaloneWorkload) HasRootCmdDescription() bool
func (*StandaloneWorkload) HasRootCmdName ¶
func (s *StandaloneWorkload) HasRootCmdName() bool
func (*StandaloneWorkload) HasSubCmdName ¶
func (*StandaloneWorkload) HasSubCmdName() bool
func (*StandaloneWorkload) IsClusterScoped ¶
func (s *StandaloneWorkload) IsClusterScoped() bool
func (*StandaloneWorkload) IsCollection ¶
func (*StandaloneWorkload) IsCollection() bool
func (*StandaloneWorkload) IsComponent ¶
func (*StandaloneWorkload) IsComponent() bool
func (*StandaloneWorkload) IsStandalone ¶
func (*StandaloneWorkload) IsStandalone() bool
func (*StandaloneWorkload) LoadManifests ¶ added in v0.4.0
func (s *StandaloneWorkload) LoadManifests(workloadPath string) error
func (*StandaloneWorkload) SetComponents ¶
func (*StandaloneWorkload) SetComponents(components []*ComponentWorkload) error
func (*StandaloneWorkload) SetNames ¶
func (s *StandaloneWorkload) SetNames()
func (*StandaloneWorkload) SetResources ¶
func (s *StandaloneWorkload) SetResources(workloadPath string) error
func (*StandaloneWorkload) Validate ¶
func (s *StandaloneWorkload) Validate() error
type StandaloneWorkloadSpec ¶
type StandaloneWorkloadSpec struct { API WorkloadAPISpec `json:"api" yaml:"api"` CompanionCliRootcmd CliCommand `json:"companionCliRootcmd" yaml:"companionCliRootcmd" validate:"omitempty"` WorkloadSpec `yaml:",inline"` }
StandaloneWorkloadSpec defines the attributes for a standalone workload.
type WorkloadAPIBuilder ¶
type WorkloadAPIBuilder interface { Validate() error IsClusterScoped() bool IsStandalone() bool IsComponent() bool IsCollection() bool HasSubCmdName() bool HasChildResources() bool GetName() string GetPackageName() string GetDomain() string GetAPIGroup() string GetAPIVersion() string GetAPIKind() string GetDependencies() []*ComponentWorkload GetCollection() *WorkloadCollection GetComponents() []*ComponentWorkload GetSourceFiles() *[]SourceFile GetAPISpecFields() *APIFields GetRBACRules() *[]RBACRule GetOwnershipRules() *[]OwnershipRule GetComponentResource(domain, repo string, clusterScoped bool) *resource.Resource GetFuncNames() (createFuncNames, initFuncNames []string) GetRootCommand() *CliCommand GetSubCommand() *CliCommand SetNames() SetResources(workloadPath string) error SetComponents(components []*ComponentWorkload) error LoadManifests(workloadPath string) error }
WorkloadAPIBuilder defines the interface that must be implemented by a workload being used to configure API and controller creation.
func ProcessAPIConfig ¶
func ProcessAPIConfig(workloadConfig string) (WorkloadAPIBuilder, error)
type WorkloadAPISpec ¶ added in v0.4.0
type WorkloadAPISpec struct { Domain string `json:"domain" yaml:"domain"` Group string `json:"group" yaml:"group"` Version string `json:"version" yaml:"version"` Kind string `json:"kind" yaml:"kind"` ClusterScoped bool `json:"clusterScoped" yaml:"clusterScoped"` }
WorkloadAPISpec contains fields shared by all workload specs.
type WorkloadCollection ¶
type WorkloadCollection struct { Spec WorkloadCollectionSpec `json:"spec" yaml:"spec" validate:"required"` }
WorkloadCollection defines a workload collection.
func (*WorkloadCollection) GetAPIGroup ¶
func (c *WorkloadCollection) GetAPIGroup() string
func (*WorkloadCollection) GetAPIKind ¶
func (c *WorkloadCollection) GetAPIKind() string
func (*WorkloadCollection) GetAPISpecFields ¶
func (c *WorkloadCollection) GetAPISpecFields() *APIFields
func (*WorkloadCollection) GetAPIVersion ¶
func (c *WorkloadCollection) GetAPIVersion() string
func (*WorkloadCollection) GetCollection ¶ added in v0.5.0
func (c *WorkloadCollection) GetCollection() *WorkloadCollection
func (*WorkloadCollection) GetComponentResource ¶
func (c *WorkloadCollection) GetComponentResource(domain, repo string, clusterScoped bool) *resource.Resource
func (*WorkloadCollection) GetComponents ¶
func (c *WorkloadCollection) GetComponents() []*ComponentWorkload
func (*WorkloadCollection) GetDependencies ¶
func (c *WorkloadCollection) GetDependencies() []*ComponentWorkload
func (*WorkloadCollection) GetDomain ¶
func (c *WorkloadCollection) GetDomain() string
methods that implement WorkloadInitializer.
func (*WorkloadCollection) GetFuncNames ¶
func (c *WorkloadCollection) GetFuncNames() (createFuncNames, initFuncNames []string)
func (*WorkloadCollection) GetName ¶
func (c *WorkloadCollection) GetName() string
methods that implement WorkloadAPIBuilder.
func (*WorkloadCollection) GetOwnershipRules ¶
func (*WorkloadCollection) GetOwnershipRules() *[]OwnershipRule
func (*WorkloadCollection) GetPackageName ¶
func (c *WorkloadCollection) GetPackageName() string
func (*WorkloadCollection) GetRBACRules ¶
func (c *WorkloadCollection) GetRBACRules() *[]RBACRule
func (*WorkloadCollection) GetRootCommand ¶ added in v0.5.0
func (c *WorkloadCollection) GetRootCommand() *CliCommand
func (*WorkloadCollection) GetSourceFiles ¶
func (c *WorkloadCollection) GetSourceFiles() *[]SourceFile
func (*WorkloadCollection) GetSubCommand ¶ added in v0.5.0
func (c *WorkloadCollection) GetSubCommand() *CliCommand
func (*WorkloadCollection) GetWorkloadKind ¶
func (c *WorkloadCollection) GetWorkloadKind() WorkloadKind
func (*WorkloadCollection) HasChildResources ¶
func (c *WorkloadCollection) HasChildResources() bool
func (*WorkloadCollection) HasRootCmdDescription ¶ added in v0.3.0
func (c *WorkloadCollection) HasRootCmdDescription() bool
func (*WorkloadCollection) HasRootCmdName ¶
func (c *WorkloadCollection) HasRootCmdName() bool
func (*WorkloadCollection) HasSubCmdDescription ¶ added in v0.3.0
func (c *WorkloadCollection) HasSubCmdDescription() bool
func (*WorkloadCollection) HasSubCmdName ¶
func (c *WorkloadCollection) HasSubCmdName() bool
func (*WorkloadCollection) IsClusterScoped ¶
func (c *WorkloadCollection) IsClusterScoped() bool
func (*WorkloadCollection) IsCollection ¶
func (c *WorkloadCollection) IsCollection() bool
func (*WorkloadCollection) IsComponent ¶
func (c *WorkloadCollection) IsComponent() bool
func (*WorkloadCollection) IsStandalone ¶
func (c *WorkloadCollection) IsStandalone() bool
func (*WorkloadCollection) LoadManifests ¶ added in v0.4.0
func (c *WorkloadCollection) LoadManifests(workloadPath string) error
func (*WorkloadCollection) SetComponents ¶
func (c *WorkloadCollection) SetComponents(components []*ComponentWorkload) error
func (*WorkloadCollection) SetNames ¶
func (c *WorkloadCollection) SetNames()
func (*WorkloadCollection) SetResources ¶
func (c *WorkloadCollection) SetResources(workloadPath string) error
func (*WorkloadCollection) Validate ¶
func (c *WorkloadCollection) Validate() error
type WorkloadCollectionSpec ¶
type WorkloadCollectionSpec struct { API WorkloadAPISpec `json:"api" yaml:"api"` CompanionCliRootcmd CliCommand `json:"companionCliRootcmd" yaml:"companionCliRootcmd" validate:"omitempty"` CompanionCliSubcmd CliCommand `json:"companionCliSubcmd" yaml:"companionCliSubcmd" validate:"omitempty"` ComponentFiles []string `json:"componentFiles" yaml:"componentFiles"` Components []*ComponentWorkload WorkloadSpec `yaml:",inline"` }
WorkloadCollectionSpec defines the attributes for a workload collection.
type WorkloadIdentifier ¶
type WorkloadIdentifier interface { GetName() string GetWorkloadKind() WorkloadKind }
WorkloadIdentifier defines an interface for identifying any workload.
type WorkloadInitializer ¶
type WorkloadInitializer interface { Validate() error HasRootCmdName() bool GetDomain() string GetRootCommand() *CliCommand SetNames() IsCollection() bool }
WorkloadInitializer defines the interface that must be implemented by a workload being used to configure project initialization.
func ProcessInitConfig ¶
func ProcessInitConfig(workloadConfig string) (WorkloadInitializer, error)
type WorkloadKind ¶
type WorkloadKind int32
WorkloadKind indicates which of the supported workload kinds are being used.
const ( WorkloadKindUnknown WorkloadKind = iota WorkloadKindStandalone WorkloadKindCollection WorkloadKindComponent )
func (WorkloadKind) String ¶ added in v0.4.0
func (wk WorkloadKind) String() string
func (*WorkloadKind) UnmarshalJSON ¶ added in v0.4.0
func (wk *WorkloadKind) UnmarshalJSON(data []byte) error
func (*WorkloadKind) UnmarshalYAML ¶ added in v0.4.0
func (wk *WorkloadKind) UnmarshalYAML(node *yaml.Node) error
type WorkloadShared ¶
type WorkloadShared struct {}
WorkloadShared contains fields shared by all workloads.
type WorkloadSpec ¶ added in v0.4.0
type WorkloadSpec struct { Resources []*Resource `json:"resources" yaml:"resources"` Collection *WorkloadCollection APISpecFields *APIFields SourceFiles *[]SourceFile RBACRules *RBACRules OwnershipRules *OwnershipRules }
WorkloadSpec contains information required to generate source code.