application

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Traits = "traits"
	Scopes = "scopes"
)

Variables

This section is empty.

Functions

func ConvertDataByType

func ConvertDataByType(val interface{}, tp cue.Kind) interface{}

ConvertDataByType will fix int become float after yaml.unmarshal

func CreateOrUpdateAppConfig

func CreateOrUpdateAppConfig(ctx context.Context, client client.Client, appConfig v1alpha2.ApplicationConfiguration) error

func CreateOrUpdateComponent

func CreateOrUpdateComponent(ctx context.Context, client client.Client, comp v1alpha2.Component) error

func CreateScopes

func CreateScopes(ctx context.Context, client client.Client, scopes []oam.Object) error

func Delete

func Delete(envName, appName string) error

func EvalToObject

func EvalToObject(capName string, data map[string]interface{}) (*unstructured.Unstructured, error)

func FormatDefaultHealthScopeName

func FormatDefaultHealthScopeName(appName string) string

func NotWorkload

func NotWorkload(tp string) bool

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

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) Run

func (app *Application) Run(ctx context.Context, client client.Client, env *types.EnvMeta) 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

Jump to

Keyboard shortcuts

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