generator

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2025 License: MIT Imports: 8 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 {
	// contains filtered or unexported fields
}

Generator 代码生成器

func New

func New(opts Options) (*Generator, error)

New 创建代码生成器实例

func (*Generator) Generate

func (g *Generator) Generate(services []*parser.Service) error

Generate 根据服务定义生成代码

type Options

type Options struct {
	TemplateFS  *embed.FS // 模板文件系统
	OutputDir   string    // 输出目录
	ImportPath  string    // 项目导入路径
	ServiceName string    // 服务名称 (可选,默认从IDL获取)
	Protocols   []string  // 支持的协议 (http, grpc等)
	WithConfig  bool      // 是否生成配置文件
	WithDocs    bool      // 是否生成文档
	WithTests   bool      // 是否生成测试文件
}

Options 生成器配置选项

Jump to

Keyboard shortcuts

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