generator

package
v0.0.0-...-18ca995 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	Lang Lang

	// OutputDir is the output directory for generated files.
	OutputDir string

	// TestOutputDir is the output directory for generated test files.
	// If unspecified, it defaults to OutputDir.
	TestOutputDir string

	// TODO: refactor Generator to avoid needing both SchemaContent and parsed schema as input.
	SchemaContent []byte
	// contains filtered or unexported fields
}

func (*Generator) GenFile

func (g *Generator) GenFile(schema *schema.Schema) error

type Lang

type Lang string

Lang is the target language for code generation.

const (
	LangGo   Lang = "go"
	LangJava Lang = "java"
)

type MultimapTemplateModel

type MultimapTemplateModel struct {
	PackageName  string
	MultimapName string
	Key          genMapFieldDef
	Value        genMapFieldDef
}

type TypeFlags

type TypeFlags struct {
	// PassByPtr indicates that the value of this type is passed by pointer to Exported()
	// when it is a function parameter or when it is returned by a function.
	PassByPtr bool

	// StoreByPtr indicates that struct fields of the value of this type is stored as a
	// pointer to Exported(). If this is false that the fields are simply of Exported().
	StoreByPtr bool

	// TakePtr is true when a pointer must be taken of the field to pass it as a parameter when encoding or comparing.
	TakePtr bool

	// DecodeByPtr is true when a pointer must be taken of the field to pass it as a parameter to Decode().
	DecodeByPtr bool

	IsEnum bool
}

Jump to

Keyboard shortcuts

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