runner

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 5 Imported by: 7

Documentation

Index

Constants

View Source
const EXTERNAL_PKGS_ARG_PATTERN = "%s=%s"

The pattern of the external package argument.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

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

Compiler is a wrapper of kcl compiler.

func DefaultCompiler

func DefaultCompiler() *Compiler

DefaultCompiler will create a default compiler.

func (*Compiler) AddDepPath

func (compiler *Compiler) AddDepPath(depName string, depPath string) *Compiler

AddDep will add a file path to the dependency list.

func (*Compiler) AddKFile

func (compiler *Compiler) AddKFile(kFilePath string) *Compiler

AddKFile will add a k file to the compiler.

func (*Compiler) AddKclOption

func (compiler *Compiler) AddKclOption(opt kcl.Option) *Compiler

AddKclOption will add a kcl option to the compiler.

func (*Compiler) Run

func (compiler *Compiler) Run() (*kcl.KCLResultList, error)

Call KCL Compiler and return the result.

func (*Compiler) SetKclCliArgs

func (compiler *Compiler) SetKclCliArgs(kclCliArgs string) *Compiler

SetKclCliArgs will set the kcl cli arguments.

type Flag

type Flag struct {
	ExternalPkg []string `arg:"-E,--external,separate"`
	Options     []string `arg:"-D,--argument,separate"`
	Overrides   []string `arg:"-O,--overrides,separate"`
	DisableNone bool     `arg:"-n,--disable-none" default:"false"`
	SortKeys    bool     `arg:"-k,--sort-keys" default:"false"`
	Settings    string   `arg:"-Y,--settings" default:""`
}

func ParseArgs

func ParseArgs(arguments []string) (Flag, error)

ParseArgs parses the arguments and returns the options.

func (*Flag) IntoKclOptions

func (flag *Flag) IntoKclOptions() kcl.Option

IntoKclOptions converts the flag into kcl options.

Jump to

Keyboard shortcuts

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