generator

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CapitalizeASCII

func CapitalizeASCII(s string) string

CapitalizeASCII capitalizes the first ASCII letter of a string.

func GetEnum

func GetEnum(files map[string]tidl.Document, name string) (tidl.Enum, bool)

GetEnum searches all documents for an enum type with the given name.

func GetType

func GetType(files map[string]tidl.Document, name string) (tidl.Type, bool)

GetType searches all documents for a type with the given name.

func RegisterGenerator

func RegisterGenerator(language string, g Generator)

RegisterGenerator registers a new generator for the given language.

Types

type Config

type Config struct {
	IDLSrcDir    string // Directory containing source IDL files
	OutputDir    string // Directory where generated code will be written
	EnableServer bool   // Whether to generate server code
	EnableClient bool   // Whether to generate client code
	PackageName  string // Go package name for generated code
	ToolVersion  string // Version of the code generation tool
}

Config holds the configuration options for the code generator.

type Generator

type Generator interface {
	Gen(config *Config, files map[string]tidl.Document, meta *tidl.MetaInfo) error
}

Generator defines the interface that any language-specific generator must implement. The Gen method generates code based on the given configuration, documents, and metadata.

func GetGenerator

func GetGenerator(language string) (Generator, bool)

GetGenerator retrieves a registered generator for a given language.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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