Documentation ¶
Index ¶
- Constants
- Variables
- func FormatDefaultHealthScopeName(appName string) string
- type AppFile
- type Build
- type Docker
- type Push
- type Service
- func (s Service) GetBuild() *Build
- func (s Service) GetConfig() map[string]interface{}
- func (s Service) GetType() string
- func (s Service) GetUserConfigName() string
- func (s Service) RenderService(tm template.Manager, name, ns string, cg configGetter) (*v1alpha2.ApplicationConfigurationComponent, *v1alpha2.Component, error)
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
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
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) BuildOAM ¶
func (app *AppFile) BuildOAM(ns string, io cmdutil.IOStreams, tm template.Manager, slience bool) ( []*v1alpha2.Component, *v1alpha2.ApplicationConfiguration, []oam.Object, error)
BuildOAM renders Appfile into AppConfig, Components. It also builds images for services if defined.
func (*AppFile) GetServices ¶
GetServices will get all services defined in AppFile
type Push ¶
type Push struct { Local string `json:"local,omitempty"` Registry string `json:"registry,omitempty"` }
Push defines where to push your image
type Service ¶
type Service map[string]interface{}
Service defines the service spec for AppFile, it will contain all information a service realted including OAM component, traits, source to image, etc...
func (Service) GetConfig ¶
GetConfig will get OAM workload and trait information exclude inner section('build','type' and 'config')
func (Service) GetUserConfigName ¶ added in v0.0.9
GetUserConfigName get user config from AppFile, it will contain config file in it.
func (Service) RenderService ¶
func (s Service) RenderService(tm template.Manager, name, ns string, cg configGetter) (*v1alpha2.ApplicationConfigurationComponent, *v1alpha2.Component, error)
RenderService render all capabilities of a service to CUE values of a Component. It outputs a Component which will be marshaled as standalone Component and also returned AppConfig Component section.