Documentation ¶
Overview ¶
Package kcl defines the top-level interface for KCL.
Index ¶
- func GetSchemaType(file, code, schemaName string) ([]*gpyrpc.KclType, error)
- func GetSchemaTypeMapping(file, code, schemaName string) (map[string]*gpyrpc.KclType, error)
- type KCLResult
- type KCLResultList
- func (p *KCLResultList) First() KCLResult
- func (p *KCLResultList) Get(i int) KCLResult
- func (p *KCLResultList) GetPyEscapedTime() string
- func (p *KCLResultList) GetRawJsonResult() string
- func (p *KCLResultList) GetRawYamlResult() string
- func (p *KCLResultList) Len() int
- func (p *KCLResultList) Slice() []KCLResult
- func (p *KCLResultList) Tail() KCLResult
- type KclType
- type Option
- func NewOption() *Option
- func ParseArgs(pathList []string, opts ...Option) (Option, error)
- func WithCode(codes ...string) Option
- func WithDisableNone(disableNone bool) Option
- func WithExternalPkgs(key_value_list ...string) Option
- func WithIncludeSchemaTypePath(includeSchemaTypePath bool) Option
- func WithKFilenames(filenames ...string) Option
- func WithOptions(key_value_list ...string) Option
- func WithOverrides(override_list ...string) Option
- func WithPrintOverridesAST(printOverrideAst bool) Option
- func WithSettings(filename string) Option
- func WithSortKeys(sortKeys bool) Option
- func WithWorkDir(s string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KCLResult ¶
type KCLResult map[string]interface{}
func (KCLResult) JSONString ¶
func (KCLResult) YAMLString ¶
type KCLResultList ¶
type KCLResultList struct {
// contains filtered or unexported fields
}
func MustRun ¶
func MustRun(path string, opts ...Option) *KCLResultList
func RunWithOpts ¶
func RunWithOpts(opts ...Option) (*KCLResultList, error)
RunWithOpts is the same as Run, but it does not require a path as input. Note: you need to specify the path in options by method WithKFilenameList() or the workdir in method WorkDir(), or it will return an 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 Option ¶
type Option struct { *gpyrpc.ExecProgram_Args Err error }
func WithExternalPkgs ¶
kcl -E aaa=/xx/xxx/aaa main.k
func WithIncludeSchemaTypePath ¶ added in v0.5.4
WithIncludeSchemaTypePath returns a Option which hold a include schema type path switch.
func WithKFilenames ¶
func WithOverrides ¶
kcl -O pkgpath:path.to.field=field_value
func WithPrintOverridesAST ¶
func WithWorkDir ¶
func (*Option) JSONString ¶
Click to show internal directories.
Click to hide internal directories.