Documentation ¶
Index ¶
- func CreateOrUpdateAppConfig(ctx context.Context, client client.Client, ...) error
- func CreateOrUpdateComponent(ctx context.Context, client client.Client, comp *v1alpha2.Component) error
- func CreateScopes(ctx context.Context, client client.Client, scopes []oam.Object) error
- func Delete(envName, appName string) error
- func GetAppConfig(ctx context.Context, c client.Client, app *Application, env *types.EnvMeta) (*v1alpha2.ApplicationConfiguration, error)
- func IsNotFound(appName string, err error) bool
- type Application
- func (app *Application) BuildRun(ctx context.Context, client client.Client, env *types.EnvMeta, ...) error
- func (app *Application) GetComponents() []string
- func (app *Application) GetServiceConfig(componentName string) (string, map[string]interface{})
- func (app *Application) GetTraitNames(componentName string) ([]string, error)
- func (app *Application) GetTraits(componentName string) (map[string]map[string]interface{}, error)
- func (app *Application) GetTraitsByType(componentName, traitType string) (map[string]interface{}, error)
- func (app *Application) GetWorkload(componentName string) (string, map[string]interface{})
- func (app *Application) OAM(env *types.EnvMeta, io cmdutil.IOStreams, silence bool) ([]*v1alpha2.Component, *v1alpha2.ApplicationConfiguration, []oam.Object, error)
- func (app *Application) RemoveComponent(componentName string) error
- func (app *Application) RemoveTrait(componentName, traitType string) error
- func (app *Application) Run(ctx context.Context, client client.Client, ...) error
- func (app *Application) Save(envName string) error
- func (app *Application) SetTrait(componentName, traitType string, traitData map[string]interface{}) error
- func (app *Application) SetWorkload(componentName, workloadType string, workloadData map[string]interface{}) error
- func (app *Application) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdateAppConfig ¶
func CreateOrUpdateAppConfig(ctx context.Context, client client.Client, appConfig *v1alpha2.ApplicationConfiguration) error
CreateOrUpdateAppConfig will create if not exist and update if exists.
func CreateOrUpdateComponent ¶
func CreateOrUpdateComponent(ctx context.Context, client client.Client, comp *v1alpha2.Component) error
CreateOrUpdateComponent will create if not exist and update if exists.
func CreateScopes ¶
CreateScopes will create all scopes
func GetAppConfig ¶ added in v0.1.1
func GetAppConfig(ctx context.Context, c client.Client, app *Application, env *types.EnvMeta) (*v1alpha2.ApplicationConfiguration, error)
GetAppConfig will get AppConfig from K8s cluster.
func IsNotFound ¶ added in v0.2.2
IsNotFound is application not found error
Types ¶
type Application ¶
type Application struct { *appfile.AppFile `json:",inline"` // contains filtered or unexported fields }
Application is an implementation level object for Appfile, all vela commands will access AppFile from Appliction struct here.
func Load ¶
func Load(envName, appName string) (*Application, error)
Load will load application with env and name from default vela home dir.
func LoadFromFile ¶
func LoadFromFile(fileName string) (*Application, error)
LoadFromFile will load application from file
func MatchAppByComp ¶
func MatchAppByComp(envName, compName string) (*Application, error)
MatchAppByComp will get application with componentName without AppName.
func NewEmptyApplication ¶ added in v0.2.2
func NewEmptyApplication() (*Application, error)
NewEmptyApplication new empty application, only set tm
func (*Application) BuildRun ¶ added in v0.0.9
func (app *Application) BuildRun(ctx context.Context, client client.Client, env *types.EnvMeta, io cmdutil.IOStreams) error
BuildRun will build OAM and deploy from Appfile
func (*Application) GetComponents ¶
func (app *Application) GetComponents() []string
GetComponents will get oam components from Appfile.
func (*Application) GetServiceConfig ¶ added in v0.0.8
func (app *Application) GetServiceConfig(componentName string) (string, map[string]interface{})
GetServiceConfig will get service type and it's configuration
func (*Application) GetTraitNames ¶
func (app *Application) GetTraitNames(componentName string) ([]string, error)
GetTraitNames will list all traits attached to the specified component.
func (*Application) GetTraits ¶
func (app *Application) GetTraits(componentName string) (map[string]map[string]interface{}, error)
GetTraits will list all traits and it's configurations attached to the specified component.
func (*Application) GetTraitsByType ¶
func (app *Application) GetTraitsByType(componentName, traitType string) (map[string]interface{}, error)
GetTraitsByType will get trait configuration with specified component and trait type, we assume one type of trait can only attach to a component once.
func (*Application) GetWorkload ¶
func (app *Application) GetWorkload(componentName string) (string, map[string]interface{})
GetWorkload will get workload type and it's configuration
func (*Application) OAM ¶
func (app *Application) OAM(env *types.EnvMeta, io cmdutil.IOStreams, silence bool) ([]*v1alpha2.Component, *v1alpha2.ApplicationConfiguration, []oam.Object, error)
OAM will convert an AppFile to OAM objects TODO(wonderflow) add scope support here
func (*Application) RemoveComponent ¶
func (app *Application) RemoveComponent(componentName string) error
RemoveComponent will remove component from Appfile
func (*Application) RemoveTrait ¶
func (app *Application) RemoveTrait(componentName, traitType string) error
RemoveTrait will remove a trait from Appfile
func (*Application) Run ¶
func (app *Application) Run(ctx context.Context, client client.Client, ac *v1alpha2.ApplicationConfiguration, comps []*v1alpha2.Component, scopes []oam.Object) error
Run will deploy OAM objects.
func (*Application) Save ¶
func (app *Application) Save(envName string) error
Save will save appfile into default dir.
func (*Application) SetTrait ¶
func (app *Application) SetTrait(componentName, traitType string, traitData map[string]interface{}) error
SetTrait will set user trait for Appfile
func (*Application) SetWorkload ¶
func (app *Application) SetWorkload(componentName, workloadType string, workloadData map[string]interface{}) error
SetWorkload will set user workload for Appfile
func (*Application) Validate ¶
func (app *Application) Validate() error
Validate will validate whether an Appfile is valid.