Documentation ¶
Index ¶
- Constants
- func GetOutputSecretNames(workloads *Workload) (string, error)
- func PrepareProcessContext(k8sClient client.Client, wl *Workload, ...) (process.Context, error)
- type Appfile
- type Parser
- type Scope
- type Trait
- type Workload
- func (wl *Workload) EvalContext(ctx process.Context) error
- func (wl *Workload) EvalHealth(ctx process.Context, client client.Client, namespace string) (bool, error)
- func (wl *Workload) EvalStatus(ctx process.Context, cli client.Client, ns string) (string, error)
- func (wl *Workload) GetUserConfigName() string
- func (wl *Workload) IsCloudResourceConsumer() bool
- func (wl *Workload) IsCloudResourceProducer() bool
Constants ¶
const (
// AppfileBuiltinConfig defines the built-in config variable
AppfileBuiltinConfig = "config"
)
Variables ¶
This section is empty.
Functions ¶
func GetOutputSecretNames ¶ added in v1.0.0
GetOutputSecretNames set all secret names, which are generated by cloud resource, to context
Types ¶
type Appfile ¶ added in v0.3.1
Appfile describes application
func (*Appfile) TemplateValidate ¶ added in v0.3.1
TemplateValidate validate Template format
type Parser ¶ added in v0.3.1
type Parser struct {
// contains filtered or unexported fields
}
Parser is an application parser
func NewApplicationParser ¶ added in v0.3.1
func NewApplicationParser(cli client.Client, dm discoverymapper.DiscoveryMapper, pd *definition.PackageDiscover) *Parser
NewApplicationParser create appfile parser
func (*Parser) GenerateAppFile ¶ added in v0.3.1
func (p *Parser) GenerateAppFile(ctx context.Context, name string, app *v1beta1.Application) (*Appfile, error)
GenerateAppFile converts an application to an Appfile
func (*Parser) GenerateApplicationConfiguration ¶ added in v0.3.1
func (p *Parser) GenerateApplicationConfiguration(app *Appfile, ns string) (*v1alpha2.ApplicationConfiguration, []*v1alpha2.Component, error)
GenerateApplicationConfiguration converts an appFile to applicationConfig & Components
type Scope ¶ added in v0.3.1
type Scope struct { Name string GVK schema.GroupVersionKind }
Scope defines the scope of workload
type Trait ¶ added in v0.3.1
type Trait struct { // The Name is name of TraitDefinition, actually it's a type of the trait instance Name string CapabilityCategory types.CapabilityCategory Params map[string]interface{} Template string HealthCheckPolicy string CustomStatusFormat string FullTemplate *util.Template // contains filtered or unexported fields }
Trait is ComponentTrait
func (*Trait) EvalContext ¶ added in v0.3.1
EvalContext eval trait template and set result to context
type Workload ¶ added in v0.3.1
type Workload struct { Name string Type string CapabilityCategory types.CapabilityCategory Params map[string]interface{} Traits []*Trait Scopes []Scope FullTemplate *util.Template // OutputSecretName is the secret name which this workload will generate after it successfully generate a cloud resource OutputSecretName string // RequiredSecrets stores secret names which the workload needs from cloud resource component and its context RequiredSecrets []process.RequiredSecrets // contains filtered or unexported fields }
Workload is component
func (*Workload) EvalContext ¶ added in v0.3.1
EvalContext eval workload template and set result to context
func (*Workload) EvalHealth ¶ added in v0.3.1
func (wl *Workload) EvalHealth(ctx process.Context, client client.Client, namespace string) (bool, error)
EvalHealth eval workload health check
func (*Workload) EvalStatus ¶ added in v0.3.3
EvalStatus eval workload status
func (*Workload) GetUserConfigName ¶ added in v0.3.1
GetUserConfigName get user config from AppFile, it will contain config file in it.
func (*Workload) IsCloudResourceConsumer ¶ added in v1.0.0
IsCloudResourceConsumer checks whether a workload is cloud resource consumer role
func (*Workload) IsCloudResourceProducer ¶ added in v1.0.0
IsCloudResourceProducer checks whether a workload is cloud resource producer role