Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateCode(options *gen.CodeGenerationOptions) (*gen.CodeGenerationResult, error)
- type CCLField
- type CCLModel
- type GoGenerationContext
- func (c *GoGenerationContext) GenerateCode() error
- func (c *GoGenerationContext) GenerateConstants() error
- func (c *GoGenerationContext) GenerateHelpers() error
- func (c *GoGenerationContext) GenerateMethods() error
- func (c *GoGenerationContext) GenerateTypes() error
- func (c *GoGenerationContext) GenerateVars() error
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 ¶
type CCLField = cclValues.ModelFieldDefinition
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
Click to show internal directories.
Click to hide internal directories.