Documentation
¶
Index ¶
Constants ¶
const (
DefaultJSONAppfilePath = "./vela.json"
DefaultAppfilePath = "./vela.yaml"
DefaultUnknowFormatAppfilePath = "./Appfile"
)
DefaultAppfilePath defines the default file path that used by `vela up` command
const DefaultWorkloadType = "webservice"
DefaultWorkloadType defines the default service type if no type specified in Appfile
Variables ¶
var (
ErrImageNotDefined = errors.New("image not defined")
)
error msg used in Appfile
Functions ¶
func FormatDefaultHealthScopeName ¶ added in v0.0.9
func FormatDefaultHealthScopeName(appName string) string
FormatDefaultHealthScopeName will create a default health scope name.
Types ¶
type AppFile ¶
type AppFile struct {
Name string `json:"name"`
CreateTime time.Time `json:"createTime,omitempty"`
UpdateTime time.Time `json:"updateTime,omitempty"`
Services map[string]Service `json:"services"`
Secrets map[string]string `json:"secrets,omitempty"`
// contains filtered or unexported fields
}
AppFile defines the spec of KubeVela Appfile
func JSONToYaml ¶ added in v0.2.0
func JSONToYaml(data []byte, appFile *AppFile) (*AppFile, error)
JSONToYaml will convert JSON format appfile to yaml and load the AppFile struct
func LoadFromFile ¶
func LoadFromFile(filename string) (*AppFile, error)
LoadFromFile will read the file and load the AppFile struct
func (*AppFile) BuildOAMApplication ¶ added in v0.3.0
func (app *AppFile) BuildOAMApplication(env *types.EnvMeta, io cmdutil.IOStreams, tm template.Manager, silence bool) (*v1alpha2.Application, []oam.Object, error)
BuildOAMApplication renders Appfile into Application, Scopes and other K8s Resources.
func (*AppFile) ExecuteAppfileTasks ¶ added in v0.3.0
func (app *AppFile) ExecuteAppfileTasks(io cmdutil.IOStreams) error
ExecuteAppfileTasks will execute built-in tasks(such as image builder, etc.) and generate locally executed application
func (*AppFile) GetServices ¶
func (af *AppFile) GetServices() map[string]Service
GetServices will get all services defined in AppFile
type Service ¶
type Service map[string]interface{}
Service defines the service spec for AppFile, it will contain all related information including OAM component, traits, source to image, etc...
func (Service) GetApplicationConfig ¶ added in v0.3.0
func (s Service) GetApplicationConfig() map[string]interface{}
GetApplicationConfig will get OAM workload and trait information exclude inner section('build','type' and 'config')
func (Service) GetUserConfigName ¶ added in v0.0.9
func (s Service) GetUserConfigName() string
GetUserConfigName get user config from AppFile, it will contain config file in it.
func (Service) RenderServiceToApplicationComponent ¶ added in v0.3.0
func (s Service) RenderServiceToApplicationComponent(tm template.Manager, serviceName string) (v1alpha2.ApplicationComponent, error)
RenderServiceToApplicationComponent render all capabilities of a service to CUE values to KubeVela Application.