common

package
v0.0.0-...-3d8ba93 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ComponentsBuilders       = make(map[string]ComponentConstructor, 0)
	WorkflowStepsBuilders    = make(map[string]WorkflowStepConstructor, 0)
	WorkflowSubStepsBuilders = make(map[string]WorkflowSubStepConstructor, 0)
	PoliciesBuilders         = make(map[string]PolicyConstructor, 0)
	TraitBuilders            = make(map[string]TraitConstructor, 0)
)

Functions

func FromComponent

func FromComponent(component common.ApplicationComponent) (Component, error)

func FromK8sObject

func FromK8sObject(app v1beta1.Application) (TypedApplication, error)

func FromPolicy

func FromPolicy(policy v1beta1.AppPolicy) (Policy, error)

func FromTrait

func FromTrait(trait common.ApplicationTrait) (Trait, error)

func FromWorkflowStep

func FromWorkflowStep(step v1beta1.WorkflowStep) (WorkflowStep, error)

func New

func New() TypedApplication

New creates a new application with the given components.

func RegisterComponent

func RegisterComponent(_type string, c ComponentConstructor)

func RegisterPolicy

func RegisterPolicy(_type string, c PolicyConstructor)

func RegisterTrait

func RegisterTrait(_type string, c TraitConstructor)

func RegisterWorkflowStep

func RegisterWorkflowStep(_type string, c WorkflowStepConstructor)

func RegisterWorkflowSubStep

func RegisterWorkflowSubStep(_type string, c WorkflowSubStepConstructor)

Types

type ApplicationBuilder

type ApplicationBuilder struct {
	// contains filtered or unexported fields
}

func (*ApplicationBuilder) Annotations

func (a *ApplicationBuilder) Annotations(annotations map[string]string) TypedApplication

func (*ApplicationBuilder) Build

func (*ApplicationBuilder) GetAnnotations

func (a *ApplicationBuilder) GetAnnotations() map[string]string

func (*ApplicationBuilder) GetComponentByName

func (a *ApplicationBuilder) GetComponentByName(name string) Component

func (*ApplicationBuilder) GetComponentsByType

func (a *ApplicationBuilder) GetComponentsByType(typ string) []Component

func (*ApplicationBuilder) GetLabels

func (a *ApplicationBuilder) GetLabels() map[string]string

func (*ApplicationBuilder) GetName

func (a *ApplicationBuilder) GetName() string

func (*ApplicationBuilder) GetNamespace

func (a *ApplicationBuilder) GetNamespace() string

func (*ApplicationBuilder) GetPoliciesByType

func (a *ApplicationBuilder) GetPoliciesByType(typ string) []Policy

func (*ApplicationBuilder) GetPolicyByName

func (a *ApplicationBuilder) GetPolicyByName(name string) Policy

func (*ApplicationBuilder) GetWorkflowStepByName

func (a *ApplicationBuilder) GetWorkflowStepByName(name string) WorkflowStep

func (*ApplicationBuilder) GetWorkflowStepsByType

func (a *ApplicationBuilder) GetWorkflowStepsByType(typ string) []WorkflowStep

func (*ApplicationBuilder) Labels

func (a *ApplicationBuilder) Labels(labels map[string]string) TypedApplication

func (*ApplicationBuilder) Name

func (a *ApplicationBuilder) Name(name string) TypedApplication

func (*ApplicationBuilder) Namespace

func (a *ApplicationBuilder) Namespace(namespace string) TypedApplication

func (*ApplicationBuilder) SetComponents

func (a *ApplicationBuilder) SetComponents(components ...Component) TypedApplication

SetComponents set components to application, use component name to match, if component name not found, append it

func (*ApplicationBuilder) SetPolicies

func (a *ApplicationBuilder) SetPolicies(policies ...Policy) TypedApplication

SetPolicies set policies to application, use policy name to match, if policy name not found, append it

func (*ApplicationBuilder) SetWorkflowMode

func (a *ApplicationBuilder) SetWorkflowMode(steps, subSteps common.WorkflowMode) TypedApplication

SetWorkflowMode set the workflow mode of application

func (*ApplicationBuilder) SetWorkflowSteps

func (a *ApplicationBuilder) SetWorkflowSteps(steps ...WorkflowStep) TypedApplication

SetWorkflowSteps set workflow steps to application, use step name to match, if step name not found, append it

func (*ApplicationBuilder) ToJSON

func (a *ApplicationBuilder) ToJSON() (string, error)

func (*ApplicationBuilder) ToYAML

func (a *ApplicationBuilder) ToYAML() (string, error)

func (*ApplicationBuilder) Validate

func (a *ApplicationBuilder) Validate() error

Validate validates the application name/namespace/component/step/policy. For component/step/policy, it will validate if the required fields are set.

type ComponentConstructor

type ComponentConstructor func(comp common.ApplicationComponent) (apis.Component, error)

type PolicyConstructor

type PolicyConstructor func(policy v1beta1.AppPolicy) (apis.Policy, error)

type TraitConstructor

type TraitConstructor func(trait common.ApplicationTrait) (apis.Trait, error)

type WorkflowStepConstructor

type WorkflowStepConstructor func(step v1beta1.WorkflowStep) (apis.WorkflowStep, error)

type WorkflowSubStepConstructor

type WorkflowSubStepConstructor func(step common.WorkflowSubStep) (apis.WorkflowStep, error)

Jump to

Keyboard shortcuts

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