parser

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const AppfileBuiltinConfig = "config"

AppfileBuiltinConfig defines the built-in config variable

Variables

This section is empty.

Functions

This section is empty.

Types

type Appfile

type Appfile struct {
	Name     string
	Services []*Workload
}

Appfile describes application

func (*Appfile) TemplateValidate

func (af *Appfile) TemplateValidate() error

TemplateValidate validate Template format

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser is appfile parser

func NewParser

func NewParser(cli defclient.DefinitionClient) *Parser

NewParser create appfile parser

func (*Parser) Parse

func (pser *Parser) Parse(name string, app *v1alpha2.Application) (*Appfile, error)

Parse convert map to Appfile

type Render

type Render interface {
	// WithContext(ctx interface{}) Render
	WithParams(params interface{}) Render
	WithTemplate(raw string) Render
	Complete() (*cue.Instance, error)
}

Render is cue render

type Scope added in v0.3.0

type Scope struct {
	Name string
	GVK  schema.GroupVersionKind
}

Scope defines the scope of workload

type Trait

type Trait struct {
	Name     string
	Params   map[string]interface{}
	Template string
}

Trait is ComponentTrait

func (*Trait) EvalContext added in v0.2.2

func (trait *Trait) EvalContext(ctx process.Context) error

EvalContext eval trait template and set result to context

type Workload

type Workload struct {
	Name     string
	Type     string
	Params   map[string]interface{}
	Template string
	Traits   []*Trait
	Scopes   []Scope
}

Workload is component

func (*Workload) EvalContext added in v0.2.2

func (wl *Workload) EvalContext(ctx process.Context) error

EvalContext eval workload template and set result to context

func (*Workload) GetUserConfigName added in v0.3.0

func (wl *Workload) GetUserConfigName() string

GetUserConfigName get user config from AppFile, it will contain config file in it.

Jump to

Keyboard shortcuts

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