compile

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Provide general KCL compilation method

Index

Constants

View Source
const (
	KusionKclPathEnv = "KUSION_KCL_PATH"
	ID               = "id"
	Type             = "type"
	Attributes       = "attributes"
)

Variables

This section is empty.

Functions

func CompileUsingCmd

func CompileUsingCmd(sourceKclFiles []string, targetFile string, args map[string]string, settings []string) (string, string, error)

Simply call kcl cmd

func EnableRPC

func EnableRPC() bool

func GenerateSpec added in v0.7.2

func GenerateSpec(o *Options, stack *projectstack.Stack) (*models.Spec, error)

func GetKclPath

func GetKclPath() string

Get kcl cli path

func GetKclvmPath

func GetKclvmPath() string

Get kclvm cli path

func Init

func Init() error

func Overwrite

func Overwrite(fileName string, overrides []string) (bool, error)

Types

type CompileResult

type CompileResult struct {
	Documents     []kcl.KCLResult
	RawYAMLResult string
}

The result of a KCL compilation

func Compile

func Compile(workDir string, filenames, settings, arguments, overrides []string, disableNone bool, overrideAST bool) (*CompileResult, error)

Compile General KCL compilation method

func NewCompileResult

func NewCompileResult(k *kcl.KCLResultList) *CompileResult

New a CompileResult by KCLResultList

func NewCompileResultByMapList

func NewCompileResultByMapList(mapList []map[string]interface{}) *CompileResult

New a CompileResult by map array

func (*CompileResult) RawYAML added in v0.4.1

func (c *CompileResult) RawYAML() string

type Options added in v0.7.2

type Options struct {
	WorkDir     string
	Filenames   []string
	Settings    []string
	Arguments   []string
	Overrides   []string
	DisableNone bool
	OverrideAST bool
	NoStyle     bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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