kcl

package
v0.4.1-alpha8 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package kcl defines the top-level interface for the Kusion Configuration Language (KCL).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSchemaType

func GetSchemaType(file, code, schemaName string) ([]*gpyrpc.KclType, error)

Types

type KCLResult

type KCLResult map[string]interface{}

func EvalCode

func EvalCode(code string) (*KCLResult, error)

func (KCLResult) Get

func (m KCLResult) Get(key string, target ...interface{}) interface{}

func (KCLResult) GetValue

func (m KCLResult) GetValue(key string, target ...interface{}) (value interface{}, err error)

func (KCLResult) JSONString

func (m KCLResult) JSONString() string

func (KCLResult) YAMLString

func (m KCLResult) YAMLString() string

type KCLResultList

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

func MustRun

func MustRun(path string, opts ...Option) *KCLResultList

func Run

func Run(path string, opts ...Option) (*KCLResultList, error)

func RunFiles

func RunFiles(paths []string, opts ...Option) (*KCLResultList, error)

func (*KCLResultList) First

func (p *KCLResultList) First() KCLResult

func (*KCLResultList) Get

func (p *KCLResultList) Get(i int) KCLResult

func (*KCLResultList) GetPyEscapedTime

func (p *KCLResultList) GetPyEscapedTime() string

func (*KCLResultList) GetRawJsonResult

func (p *KCLResultList) GetRawJsonResult() string

func (*KCLResultList) GetRawYamlResult

func (p *KCLResultList) GetRawYamlResult() string

func (*KCLResultList) Len

func (p *KCLResultList) Len() int

func (*KCLResultList) Slice

func (p *KCLResultList) Slice() []KCLResult

func (*KCLResultList) Tail

func (p *KCLResultList) Tail() KCLResult

type KclType

type KclType = gpyrpc.KclType

type Option

type Option struct {
	*gpyrpc.ExecProgram_Args
	Err error
}

func ParseArgs

func ParseArgs(pathList []string, opts ...Option) (Option, error)

func WithCode

func WithCode(codes ...string) Option

func WithDisableNone

func WithDisableNone(disableNone bool) Option

kcl -n

func WithIncludeSchemaTypePath

func WithIncludeSchemaTypePath(includeSchemaTypePath bool) Option

func WithKFilenames

func WithKFilenames(filenames ...string) Option

func WithOptions

func WithOptions(key_value_list ...string) Option

kcl -D aa=11 -D bb=22 main.k

func WithOverrides

func WithOverrides(override_list ...string) Option

kcl -O pkgpath:path.to.field=field_value

func WithPrintOverridesAST

func WithPrintOverridesAST(printOverrideAst bool) Option

func WithSettings

func WithSettings(filename string) Option

kcl -Y settings.yaml

func WithSortKeys

func WithSortKeys(sortKeys bool) Option

func WithWorkDir

func WithWorkDir(s string) Option

func (*Option) JSONString

func (p *Option) JSONString() string

Jump to

Keyboard shortcuts

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