Documentation ¶
Index ¶
- Constants
- func ConvertDataByType(val interface{}, tp cue.Kind) interface{}
- 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 EvalToObject(capName string, data map[string]interface{}) (*unstructured.Unstructured, error)
- func FormatDefaultHealthScopeName(appName string) string
- func NotWorkload(tp string) bool
- type Application
- func (app *Application) GetComponentTraits(componentName string) ([]v1alpha2.ComponentTrait, error)
- func (app *Application) GetComponents() []string
- 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) GetWorkloadObject(componentName string) (*unstructured.Unstructured, string, error)
- func (app *Application) OAM(env *types.EnvMeta) ([]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, env *types.EnvMeta) 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 ¶
View Source
const ( Traits = "traits" Scopes = "scopes" )
Variables ¶
This section is empty.
Functions ¶
func ConvertDataByType ¶
ConvertDataByType will fix int become float after yaml.unmarshal
func CreateOrUpdateAppConfig ¶
func CreateOrUpdateComponent ¶
func CreateScopes ¶
func EvalToObject ¶
func EvalToObject(capName string, data map[string]interface{}) (*unstructured.Unstructured, error)
func NotWorkload ¶
Types ¶
type Application ¶
type Application struct { Name string `json:"name"` // key of map is component name Components map[string]map[string]interface{} `json:"components"` Secrets map[string]map[string]interface{} `json:"secrets"` Scopes map[string]map[string]interface{} `json:"globalScopes"` CreateTime time.Time `json:"createTime,omitempty"` UpdateTime time.Time `json:"updateTime,omitempty"` }
func List ¶
func List(envName string) ([]*Application, error)
func Load ¶
func Load(envName, appName string) (*Application, error)
func LoadFromFile ¶
func LoadFromFile(fileName string) (*Application, error)
func MatchAppByComp ¶
func MatchAppByComp(envName, compName string) (*Application, error)
func (*Application) GetComponentTraits ¶
func (app *Application) GetComponentTraits(componentName string) ([]v1alpha2.ComponentTrait, error)
func (*Application) GetComponents ¶
func (app *Application) GetComponents() []string
func (*Application) GetTraitNames ¶
func (app *Application) GetTraitNames(componentName string) ([]string, error)
func (*Application) GetTraits ¶
func (app *Application) GetTraits(componentName string) (map[string]map[string]interface{}, error)
func (*Application) GetTraitsByType ¶
func (app *Application) GetTraitsByType(componentName, traitType string) (map[string]interface{}, error)
func (*Application) GetWorkload ¶
func (app *Application) GetWorkload(componentName string) (string, map[string]interface{})
func (*Application) GetWorkloadObject ¶
func (app *Application) GetWorkloadObject(componentName string) (*unstructured.Unstructured, string, error)
func (*Application) OAM ¶
func (app *Application) OAM(env *types.EnvMeta) ([]v1alpha2.Component, v1alpha2.ApplicationConfiguration, []oam.Object, error)
TODO(wonderflow) add scope support here
func (*Application) RemoveComponent ¶
func (app *Application) RemoveComponent(componentName string) error
func (*Application) RemoveTrait ¶
func (app *Application) RemoveTrait(componentName, traitType string) error
func (*Application) Save ¶
func (app *Application) Save(envName string) error
func (*Application) SetTrait ¶
func (app *Application) SetTrait(componentName, traitType string, traitData map[string]interface{}) error
func (*Application) SetWorkload ¶
func (app *Application) SetWorkload(componentName, workloadType string, workloadData map[string]interface{}) error
func (*Application) Validate ¶
func (app *Application) Validate() error
Click to show internal directories.
Click to hide internal directories.