definition

package
v0.0.0-...-e936fb3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AcornCueFile = "Acornfile"
	Schema       = "github.com/acorn-io/aml/schema/v1"
	AppType      = "#App"
)

Variables

View Source
var (
	TopFields = []string{
		"labels",
		"annotations",
		"name",
		"description",
		"readme",
		"info",
		"icon",
		"containers",
		"jobs",
		"acorns",
		"secrets",
		"volumes",
		"images",
		"routers",
		"services",
	}
	Defaults = []byte(`

args: {
	dev: bool | *false
	profiles: [...string]
	autoUpgrade: bool | *false
}
profiles: {
	devMode: dev: bool | *true
	autoUpgrade: autoUpgrade: bool | *true
}
`)
)

Functions

func NewAcornfile

func NewAcornfile(data []byte) []cue.File

Types

type Definition

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

func NewData

func NewData(files []cue.File) (*Definition, error)

func NewDefinition

func NewDefinition(files []cue.File) (*Definition, error)

func (*Definition) Args

func (a *Definition) Args() (*ParamSpec, error)

func (*Definition) Decode

func (a *Definition) Decode(out interface{}) error

func (*Definition) WithArgs

func (a *Definition) WithArgs(args map[string]any, profiles []string) (*Definition, map[string]any, error)

type Param

type Param struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Type        string `json:"type,omitempty" wrangler:"options=string|int|float|bool|object|array"`
	Schema      string `json:"schema,omitempty"`
}

type ParamSpec

type ParamSpec struct {
	Params   []Param   `json:"params,omitempty"`
	Profiles []Profile `json:"profiles,omitempty"`
}

type Profile

type Profile struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

Jump to

Keyboard shortcuts

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