kclgen

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package kclgen provides code generation utilities for KCL.

This package implements functionality to generate KCL code programmatically, supporting use cases such as schema generation from external sources, type generation, and other code synthesis operations.

Index

Constants

View Source
const (
	ModeAuto Mode = iota
	ModeGoStruct
	ModeJSONSchema
	ModeTerraformSchema
	ModeJSON
	ModeYAML
	ModeTOML
	ModeProto
	ModeTextProto

	OriginalName CastingOption = iota
	SnakeCase
	CamelCase
)

Variables

View Source
var Gen = &gen{}

Gen is a concurrency-safe KCL generator.

View Source
var GenOpenAPI = mustNewGenOpenAPI()

GenOpenAPI is a concurrency-safe KCL OpenAPI/CRD generator.

Functions

func FixKCLSchema

func FixKCLSchema(kclSchema string, removeDefaults bool) string

Types

type CastingOption

type CastingOption int

CastingOption is the option for casting field names.

type GenKclOptions

type GenKclOptions struct {
	Mode                  Mode
	CastingOption         CastingOption
	UseIntegersForNumbers bool
	RemoveDefaults        bool
}

GenKclOptions contains options for KCL generation.

type Mode

type Mode int

Mode is the mode of KCL schema code generation.

Jump to

Keyboard shortcuts

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