Documentation
¶
Index ¶
- func Action(ctx context.Context, c *cli.Command) error
- type CodeGenerationService
- type GenerateOptions
- func (o *GenerateOptions) GetAbsoluteOutputDir(projectPath string) string
- func (o *GenerateOptions) SetDryRun(dryRun bool) *GenerateOptions
- func (o *GenerateOptions) SetFeatures(features []string) *GenerateOptions
- func (o *GenerateOptions) SetGenerateTypes(types []string) *GenerateOptions
- func (o *GenerateOptions) SetModuleName(name string) *GenerateOptions
- func (o *GenerateOptions) SetOutputDir(dir string) *GenerateOptions
- func (o *GenerateOptions) SetVerbose(verbose bool) *GenerateOptions
- func (o *GenerateOptions) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CodeGenerationService ¶
type CodeGenerationService struct {
// contains filtered or unexported fields
}
CodeGenerationService 代码生成服务
func NewCodeGenerationService ¶
func NewCodeGenerationService() *CodeGenerationService
NewCodeGenerationService 创建代码生成服务
func (*CodeGenerationService) GenerateFromAPISpec ¶
func (s *CodeGenerationService) GenerateFromAPISpec(ctx context.Context, spec *generator.APISpec, options *GenerateOptions) error
GenerateFromAPISpec 从API规范生成代码
func (*CodeGenerationService) GenerateFromProtobuf ¶
func (s *CodeGenerationService) GenerateFromProtobuf(ctx context.Context, files []*ast.ProtobufFile, options *GenerateOptions) error
GenerateFromProtobuf 从protobuf文件生成代码
type GenerateOptions ¶
type GenerateOptions struct {
OutputDir string
ModuleName string
GenerateTypes []string
Features []string
Verbose bool
DryRun bool
}
GenerateOptions 生成选项
func (*GenerateOptions) GetAbsoluteOutputDir ¶
func (o *GenerateOptions) GetAbsoluteOutputDir(projectPath string) string
GetAbsoluteOutputDir 获取绝对输出目录
func (*GenerateOptions) SetDryRun ¶
func (o *GenerateOptions) SetDryRun(dryRun bool) *GenerateOptions
SetDryRun 设置试运行模式
func (*GenerateOptions) SetFeatures ¶
func (o *GenerateOptions) SetFeatures(features []string) *GenerateOptions
SetFeatures 设置特性
func (*GenerateOptions) SetGenerateTypes ¶
func (o *GenerateOptions) SetGenerateTypes(types []string) *GenerateOptions
SetGenerateTypes 设置生成类型
func (*GenerateOptions) SetModuleName ¶
func (o *GenerateOptions) SetModuleName(name string) *GenerateOptions
SetModuleName 设置模块名
func (*GenerateOptions) SetOutputDir ¶
func (o *GenerateOptions) SetOutputDir(dir string) *GenerateOptions
SetOutputDir 设置输出目录
func (*GenerateOptions) SetVerbose ¶
func (o *GenerateOptions) SetVerbose(verbose bool) *GenerateOptions
SetVerbose 设置详细模式
Click to show internal directories.
Click to hide internal directories.