goGenerator

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConstantsFileName = "constants.go"
	MethodsFileName   = "methods.go"
	TypesFileName     = "types.go"
	HelpersFileName   = "helpers.go"
	VarsFileName      = "vars.go"
)
View Source
const (
	CurrentLanguage = gValues.LanguageGo
)

Variables

View Source
var (
	// LanguageAliases is a list of aliases for the Go language.
	LanguageAliases = []string{
		"go",
		"golang",
	}

	CCLTypesToGoTypes = map[string]string{
		"int":      "int",
		"uint":     "uint",
		"int8":     "int8",
		"uint8":    "uint8",
		"int16":    "int16",
		"uint16":   "uint16",
		"int32":    "int32",
		"uint32":   "uint32",
		"int64":    "int64",
		"uint64":   "uint64",
		"float":    "float64",
		"float64":  "float64",
		"float32":  "float32",
		"string":   "string",
		"bool":     "bool",
		"datetime": "time.Time",
		"bytes":    "[]byte",
	}
)

Functions

func GenerateCode

func GenerateCode(options *gen.CodeGenerationOptions) (*gen.CodeGenerationResult, error)

GenerateCode generates Go code from the provided CCL source file.

Types

type CCLField

CCLField is a type alias for the field definition type from the CCL library.

type CCLModel

type CCLModel = cclValues.ModelDefinition

CCLModel is a type alias for the model definition type from the CCL library.

type GoGenerationContext

type GoGenerationContext struct {
	*gen.CodeGenerationBase

	// MethodsCode is a string builder that contains the generated Go code for the methods.
	MethodsCode   *codeBuilder.CodeBuilder
	TypesCode     *codeBuilder.CodeBuilder
	HelpersCode   *codeBuilder.CodeBuilder
	VarsCode      *codeBuilder.CodeBuilder
	ConstantsCode *codeBuilder.CodeBuilder
}

func (*GoGenerationContext) GenerateCode

func (c *GoGenerationContext) GenerateCode() error

func (*GoGenerationContext) GenerateConstants

func (c *GoGenerationContext) GenerateConstants() error

func (*GoGenerationContext) GenerateHelpers

func (c *GoGenerationContext) GenerateHelpers() error

func (*GoGenerationContext) GenerateMethods

func (c *GoGenerationContext) GenerateMethods() error

func (*GoGenerationContext) GenerateTypes

func (c *GoGenerationContext) GenerateTypes() error

func (*GoGenerationContext) GenerateVars

func (c *GoGenerationContext) GenerateVars() error

Jump to

Keyboard shortcuts

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