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 (
// DefaultHealthScopeKey is the key in application for default health scope
DefaultHealthScopeKey = "healthscopes.core.oam.dev"
)
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 ¶
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 ¶
JSONToYaml will convert JSON format appfile to yaml and load the AppFile struct
func LoadFromFile ¶
LoadFromFile will read the file and load the AppFile struct
func (*AppFile) BuildOAMApplication ¶
func (app *AppFile) BuildOAMApplication(env *types.EnvMeta, io cmdutil.IOStreams, tm template.Manager, silence bool) (*v1beta1.Application, []oam.Object, error)
BuildOAMApplication renders Appfile into Application, Scopes and other K8s Resources.
func (*AppFile) ExecuteAppfileTasks ¶
ExecuteAppfileTasks will execute built-in tasks(such as image builder, etc.) and generate locally executed application
func (*AppFile) GetServices ¶
GetServices will get all services defined in AppFile
type Application ¶
Application is an implementation level object for Appfile, all vela commands will access AppFile from Appliction struct here.
type Driver ¶
type Driver interface { // Save application Save(app *Application, envName string) error // Delete application Delete(envName, appName string) error // Name of storage driver Name() string }
Driver is mutli implement interface
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 ¶
GetApplicationConfig will get OAM workload and trait information exclude inner section('build','type' and 'config')
func (Service) GetUserConfigName ¶
GetUserConfigName get user config from AppFile, it will contain config file in it.
func (Service) RenderServiceToApplicationComponent ¶
func (s Service) RenderServiceToApplicationComponent(tm template.Manager, serviceName string) (common.ApplicationComponent, error)
RenderServiceToApplicationComponent render all capabilities of a service to CUE values to KubeVela Application.