Documentation
¶
Index ¶
- Constants
- Variables
- func CloseFile(file io.ReadCloser)
- func InitializeMarkerInspector() (*inspect.Inspector, error)
- func ReadStream(fileName string) (io.ReadCloser, error)
- func SupportedMarkerDataTypes() []string
- func TransformYAML(results ...*inspect.YAMLResult) error
- type APISpec
- type APISpecField
- type ChildResource
- type CliCommand
- type CollectionFieldMarker
- type ComponentWorkload
- func (c *ComponentWorkload) GetAPIGroup() string
- func (c *ComponentWorkload) GetAPIKind() string
- func (c *ComponentWorkload) GetAPISpecFields() []*APISpecField
- func (c *ComponentWorkload) GetAPIVersion() string
- func (c *ComponentWorkload) GetComponentResource(domain, repo string, clusterScoped bool) *resource.Resource
- func (*ComponentWorkload) GetComponents() []*ComponentWorkload
- func (c *ComponentWorkload) GetDependencies() []*ComponentWorkload
- 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 (*ComponentWorkload) GetRootcommandName() string
- func (c *ComponentWorkload) GetSourceFiles() *[]SourceFile
- func (c *ComponentWorkload) GetSubcommandDescr() string
- func (c *ComponentWorkload) GetSubcommandFileName() string
- func (c *ComponentWorkload) GetSubcommandName() string
- func (c *ComponentWorkload) GetSubcommandVarName() string
- func (c *ComponentWorkload) GetWorkloadKind() WorkloadKind
- func (c *ComponentWorkload) HasChildResources() bool
- func (c *ComponentWorkload) HasSubCmdName() bool
- func (c *ComponentWorkload) IsClusterScoped() bool
- func (*ComponentWorkload) IsCollection() bool
- func (*ComponentWorkload) IsComponent() bool
- func (*ComponentWorkload) IsStandalone() bool
- 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 OwnershipRule
- type PluginConfig
- type RBACRule
- type SourceCodeTemplateData
- type SourceFile
- type StandaloneWorkload
- func (s *StandaloneWorkload) GetAPIGroup() string
- func (s *StandaloneWorkload) GetAPIKind() string
- func (s *StandaloneWorkload) GetAPISpecFields() []*APISpecField
- func (s *StandaloneWorkload) GetAPIVersion() string
- 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) GetRootCmdDescr() string
- func (s *StandaloneWorkload) GetRootCmdName() string
- func (s *StandaloneWorkload) GetRootcommandName() string
- func (s *StandaloneWorkload) GetSourceFiles() *[]SourceFile
- func (*StandaloneWorkload) GetSubcommandDescr() string
- func (*StandaloneWorkload) GetSubcommandFileName() string
- func (*StandaloneWorkload) GetSubcommandName() string
- func (*StandaloneWorkload) GetSubcommandVarName() string
- func (s *StandaloneWorkload) GetWorkloadKind() WorkloadKind
- func (s *StandaloneWorkload) HasChildResources() 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 (*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 WorkloadCollection
- func (c *WorkloadCollection) GetAPIGroup() string
- func (c *WorkloadCollection) GetAPIKind() string
- func (c *WorkloadCollection) GetAPISpecFields() []*APISpecField
- func (c *WorkloadCollection) GetAPIVersion() string
- func (*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 (*WorkloadCollection) GetRBACRules() *[]RBACRule
- func (c *WorkloadCollection) GetRootCmdDescr() string
- func (c *WorkloadCollection) GetRootCmdName() string
- func (c *WorkloadCollection) GetRootcommandName() string
- func (c *WorkloadCollection) GetSourceFiles() *[]SourceFile
- func (*WorkloadCollection) GetSubcommandDescr() string
- func (*WorkloadCollection) GetSubcommandFileName() string
- func (*WorkloadCollection) GetSubcommandName() string
- func (*WorkloadCollection) GetSubcommandVarName() string
- func (c *WorkloadCollection) GetWorkloadKind() WorkloadKind
- func (*WorkloadCollection) HasChildResources() bool
- func (c *WorkloadCollection) HasRootCmdName() bool
- func (*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) 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
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") ErrInvalidKind = errors.New("unrecognized workload kind in workload config") 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") )
Functions ¶
func ReadStream ¶
func ReadStream(fileName string) (io.ReadCloser, error)
func SupportedMarkerDataTypes ¶
func SupportedMarkerDataTypes() []string
SupportedMarkerDataTypes returns the supported data types that can be used in workload markers.
func TransformYAML ¶
func TransformYAML(results ...*inspect.YAMLResult) error
Types ¶
type APISpec ¶
type APISpec 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"` }
APISpec contains fields shared by all workload specs.
type APISpecField ¶
type APISpecField struct { FieldName string ManifestFieldName string DataType string DefaultVal string ZeroVal string APISpecContent string SampleField string DocumentationLines []string }
APISpecField represents a single field in a custom API type.
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 `json:"name" yaml:"name" validate:"required_with=Description"` Description string `json:"description" yaml:"description" validate:"required_with=Name"` VarName string FileName string }
CliCommand defines the command name and description for the root command or subcommand of a companion CLI.
type CollectionFieldMarker ¶
type CollectionFieldMarker FieldMarker
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() []*APISpecField
func (*ComponentWorkload) GetAPIVersion ¶
func (c *ComponentWorkload) GetAPIVersion() string
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) GetFuncNames ¶
func (c *ComponentWorkload) GetFuncNames() (createFuncNames, initFuncNames []string)
func (*ComponentWorkload) GetName ¶
func (c *ComponentWorkload) GetName() string
methods that implement WorkloadAPIBuilder.
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) GetRootcommandName ¶
func (*ComponentWorkload) GetRootcommandName() string
func (*ComponentWorkload) GetSourceFiles ¶
func (c *ComponentWorkload) GetSourceFiles() *[]SourceFile
func (*ComponentWorkload) GetSubcommandDescr ¶
func (c *ComponentWorkload) GetSubcommandDescr() string
func (*ComponentWorkload) GetSubcommandFileName ¶
func (c *ComponentWorkload) GetSubcommandFileName() string
func (*ComponentWorkload) GetSubcommandName ¶
func (c *ComponentWorkload) GetSubcommandName() string
func (*ComponentWorkload) GetSubcommandVarName ¶
func (c *ComponentWorkload) GetSubcommandVarName() string
func (*ComponentWorkload) GetWorkloadKind ¶
func (c *ComponentWorkload) GetWorkloadKind() WorkloadKind
func (*ComponentWorkload) HasChildResources ¶
func (c *ComponentWorkload) HasChildResources() 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) 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 APISpec `json:"api" yaml:"api"` CompanionCliSubcmd CliCommand `json:"companionCliSubcmd" yaml:"companionCliSubcmd" validate:"omitempty"` Resources []string `json:"resources" yaml:"resources"` Dependencies []string `json:"dependencies" yaml:"dependencies"` ConfigPath string ComponentDependencies []*ComponentWorkload APISpecFields []*APISpecField SourceFiles []SourceFile RBACRules []RBACRule OwnershipRules []OwnershipRule }
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"` // contains filtered or unexported fields }
func (FieldMarker) String ¶
func (fm FieldMarker) String() string
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 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 SourceCodeTemplateData ¶
type SourceCodeTemplateData struct { SpecField []*APISpecField SourceFile *[]SourceFile RBACRule *[]RBACRule OwnershipRule *[]OwnershipRule }
SourceCodeTemplateData is a collection of variables used to generate source code.
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() []*APISpecField
func (*StandaloneWorkload) GetAPIVersion ¶
func (s *StandaloneWorkload) GetAPIVersion() string
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) GetRootCmdDescr ¶
func (s *StandaloneWorkload) GetRootCmdDescr() string
func (*StandaloneWorkload) GetRootCmdName ¶
func (s *StandaloneWorkload) GetRootCmdName() string
func (*StandaloneWorkload) GetRootcommandName ¶
func (s *StandaloneWorkload) GetRootcommandName() string
func (*StandaloneWorkload) GetSourceFiles ¶
func (s *StandaloneWorkload) GetSourceFiles() *[]SourceFile
func (*StandaloneWorkload) GetSubcommandDescr ¶
func (*StandaloneWorkload) GetSubcommandDescr() string
func (*StandaloneWorkload) GetSubcommandFileName ¶
func (*StandaloneWorkload) GetSubcommandFileName() string
func (*StandaloneWorkload) GetSubcommandName ¶
func (*StandaloneWorkload) GetSubcommandName() string
func (*StandaloneWorkload) GetSubcommandVarName ¶
func (*StandaloneWorkload) GetSubcommandVarName() string
func (*StandaloneWorkload) GetWorkloadKind ¶
func (s *StandaloneWorkload) GetWorkloadKind() WorkloadKind
func (*StandaloneWorkload) HasChildResources ¶
func (s *StandaloneWorkload) HasChildResources() 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) 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 APISpec `json:"api" yaml:"api"` CompanionCliRootcmd CliCommand `json:"companionCliRootcmd" yaml:"companionCliRootcmd" validate:"omitempty"` Resources []string `json:"resources" yaml:"resources"` APISpecFields []*APISpecField SourceFiles []SourceFile RBACRules []RBACRule OwnershipRules []OwnershipRule }
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 GetSubcommandName() string GetSubcommandDescr() string GetSubcommandVarName() string GetSubcommandFileName() string GetRootcommandName() string GetDependencies() []*ComponentWorkload GetComponents() []*ComponentWorkload GetSourceFiles() *[]SourceFile GetAPISpecFields() []*APISpecField GetRBACRules() *[]RBACRule GetOwnershipRules() *[]OwnershipRule GetComponentResource(domain, repo string, clusterScoped bool) *resource.Resource GetFuncNames() (createFuncNames, initFuncNames []string) SetNames() SetResources(workloadPath string) error SetComponents(components []*ComponentWorkload) 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 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() []*APISpecField
func (*WorkloadCollection) GetAPIVersion ¶
func (c *WorkloadCollection) GetAPIVersion() string
func (*WorkloadCollection) GetComponentResource ¶
func (*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 (*WorkloadCollection) GetRBACRules() *[]RBACRule
func (*WorkloadCollection) GetRootCmdDescr ¶
func (c *WorkloadCollection) GetRootCmdDescr() string
func (*WorkloadCollection) GetRootCmdName ¶
func (c *WorkloadCollection) GetRootCmdName() string
func (*WorkloadCollection) GetRootcommandName ¶
func (c *WorkloadCollection) GetRootcommandName() string
func (*WorkloadCollection) GetSourceFiles ¶
func (c *WorkloadCollection) GetSourceFiles() *[]SourceFile
func (*WorkloadCollection) GetSubcommandDescr ¶
func (*WorkloadCollection) GetSubcommandDescr() string
func (*WorkloadCollection) GetSubcommandFileName ¶
func (*WorkloadCollection) GetSubcommandFileName() string
func (*WorkloadCollection) GetSubcommandName ¶
func (*WorkloadCollection) GetSubcommandName() string
func (*WorkloadCollection) GetSubcommandVarName ¶
func (*WorkloadCollection) GetSubcommandVarName() string
func (*WorkloadCollection) GetWorkloadKind ¶
func (c *WorkloadCollection) GetWorkloadKind() WorkloadKind
func (*WorkloadCollection) HasChildResources ¶
func (*WorkloadCollection) HasChildResources() bool
func (*WorkloadCollection) HasRootCmdName ¶
func (c *WorkloadCollection) HasRootCmdName() bool
func (*WorkloadCollection) HasSubCmdName ¶
func (*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) 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 APISpec `json:"api" yaml:"api"` CompanionCliRootcmd CliCommand `json:"companionCliRootcmd" yaml:"companionCliRootcmd" validate:"omitempty"` ComponentFiles []string `json:"componentFiles" yaml:"componentFiles"` Components []*ComponentWorkload APISpecFields []*APISpecField }
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 GetRootCmdName() string GetRootCmdDescr() string SetNames() }
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 string
WorkloadKind indicates which of the supported workload kinds are being used.
const ( WorkloadKindStandalone WorkloadKind = "StandaloneWorkload" WorkloadKindCollection WorkloadKind = "WorkloadCollection" WorkloadKindComponent WorkloadKind = "ComponentWorkload" )
type WorkloadShared ¶
type WorkloadShared struct {}
WorkloadShared contains fields shared by all workloads.