Documentation
¶
Index ¶
- Constants
- func MakeEntSetNillableFunc(fieldName string) string
- func MakeEntSetNillableFuncWithTransfer(fieldName string, transFunc string) string
- func RemoveTableCommentSuffix(input string) string
- func ServerFormalParameters(servers []string) []string
- func ServerImportPaths(servers []string) []string
- func ServerTransferParameters(servers []string) []string
- func SnakeToPascal(snake string) string
- func SnakeToPascalPlus(snake string) string
- type DataField
- type DataFieldArray
- type GoGenerator
- func (g *GoGenerator) GenerateAssets(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *GoGenerator) GenerateData(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *GoGenerator) GenerateEntClient(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *GoGenerator) GenerateEntRepo(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *GoGenerator) GenerateGormClient(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *GoGenerator) GenerateGormInit(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *GoGenerator) GenerateGormRepo(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *GoGenerator) GenerateGrpcServer(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *GoGenerator) GenerateMain(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *GoGenerator) GenerateRedisClient(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *GoGenerator) GenerateRestServer(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *GoGenerator) GenerateService(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *GoGenerator) GenerateWire(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *GoGenerator) GenerateWireSet(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- type MakefileGenerator
- type ProtoField
- type ProtoGenerator
- type SchemaConverter
- type TableData
- type YamlGenerator
- func (g *YamlGenerator) GenerateClientYaml(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *YamlGenerator) GenerateDataYaml(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *YamlGenerator) GenerateLoggerYaml(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
- func (g *YamlGenerator) GenerateServerYaml(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
Constants ¶
View Source
const ( ProtoFilePostfix = ".proto" RestProtoFilePrefix = "i_" )
Variables ¶
This section is empty.
Functions ¶
func MakeEntSetNillableFunc ¶ added in v0.0.4
func MakeEntSetNillableFuncWithTransfer ¶ added in v0.0.4
func RemoveTableCommentSuffix ¶ added in v0.0.4
func ServerFormalParameters ¶ added in v0.0.4
ServerFormalParameters 形参
func ServerImportPaths ¶ added in v0.0.4
ServerImportPaths returns the import paths for the given server types.
func ServerTransferParameters ¶ added in v0.0.4
ServerTransferParameters 实参
func SnakeToPascal ¶ added in v0.0.4
SnakeToPascal converts a snake_case string to PascalCase.
func SnakeToPascalPlus ¶ added in v0.0.4
Types ¶
type DataField ¶ added in v0.0.4
DataField 数据库字段定义
func (DataField) EntPascalName ¶ added in v0.0.4
func (DataField) EntSetNillableFunc ¶ added in v0.0.4
func (DataField) PascalName ¶ added in v0.0.4
type DataFieldArray ¶ added in v0.0.4
type DataFieldArray []DataField
type GoGenerator ¶
type GoGenerator struct {
*code_generator.CodeGenerator
}
GoGenerator 使用 TemplateEngine 渲染并将结果写入磁盘
func NewGoGenerator ¶
func NewGoGenerator() *GoGenerator
NewGoGenerator 创建生成器,engine 可为 nil(需要在调用前设置)
func (*GoGenerator) GenerateAssets ¶ added in v0.0.6
func (g *GoGenerator) GenerateAssets(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*GoGenerator) GenerateData ¶
func (g *GoGenerator) GenerateData(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*GoGenerator) GenerateEntClient ¶
func (g *GoGenerator) GenerateEntClient(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*GoGenerator) GenerateEntRepo ¶
func (g *GoGenerator) GenerateEntRepo(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*GoGenerator) GenerateGormClient ¶
func (g *GoGenerator) GenerateGormClient(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*GoGenerator) GenerateGormInit ¶
func (g *GoGenerator) GenerateGormInit(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*GoGenerator) GenerateGormRepo ¶
func (g *GoGenerator) GenerateGormRepo(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*GoGenerator) GenerateGrpcServer ¶
func (g *GoGenerator) GenerateGrpcServer(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*GoGenerator) GenerateMain ¶
func (g *GoGenerator) GenerateMain(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*GoGenerator) GenerateRedisClient ¶
func (g *GoGenerator) GenerateRedisClient(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*GoGenerator) GenerateRestServer ¶
func (g *GoGenerator) GenerateRestServer(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*GoGenerator) GenerateService ¶
func (g *GoGenerator) GenerateService(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*GoGenerator) GenerateWire ¶
func (g *GoGenerator) GenerateWire(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*GoGenerator) GenerateWireSet ¶ added in v0.0.5
func (g *GoGenerator) GenerateWireSet(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
type MakefileGenerator ¶ added in v0.0.5
type MakefileGenerator struct {
*code_generator.CodeGenerator
}
MakefileGenerator 使用 TemplateEngine 渲染并将结果写入磁盘
func NewMakefileGenerator ¶ added in v0.0.5
func NewMakefileGenerator() *MakefileGenerator
NewMakefileGenerator 创建生成器,engine 可为 nil(需要在调用前设置)
func (*MakefileGenerator) GenerateAppMakefile ¶ added in v0.0.5
func (g *MakefileGenerator) GenerateAppMakefile(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
type ProtoField ¶ added in v0.0.4
type ProtoField struct {
Name string // 字段名
Type string // 字段类型
Null bool // 是否允许为 NULL
Comment string // 字段注释
Number int // 字段编号
}
ProtoField 字段数据
type ProtoGenerator ¶ added in v0.0.5
type ProtoGenerator struct {
*code_generator.CodeGenerator
}
ProtoGenerator 使用 TemplateEngine 渲染并将结果写入磁盘
func NewProtoGenerator ¶ added in v0.0.5
func NewProtoGenerator() *ProtoGenerator
NewProtoGenerator 创建生成器,engine 可为 nil(需要在调用前设置)
func (*ProtoGenerator) GenerateGrpcServiceProto ¶ added in v0.0.5
func (g *ProtoGenerator) GenerateGrpcServiceProto(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*ProtoGenerator) GenerateRestServiceProto ¶ added in v0.0.5
func (g *ProtoGenerator) GenerateRestServiceProto(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
type SchemaConverter ¶
type TableData ¶
type TableData struct {
Name string // 表名
Comment string // 表注释
Charset string // 字符集
Collation string // 排序规则
Fields []ProtoField // 字段数据
}
TableData 表数据
func (TableData) WithComment ¶
type YamlGenerator ¶ added in v0.0.5
type YamlGenerator struct {
*code_generator.CodeGenerator
}
YamlGenerator 使用 TemplateEngine 渲染并将结果写入磁盘
func NewYamlGenerator ¶ added in v0.0.5
func NewYamlGenerator() *YamlGenerator
NewYamlGenerator 创建生成器,engine 可为 nil(需要在调用前设置)
func (*YamlGenerator) GenerateClientYaml ¶ added in v0.0.5
func (g *YamlGenerator) GenerateClientYaml(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*YamlGenerator) GenerateDataYaml ¶ added in v0.0.5
func (g *YamlGenerator) GenerateDataYaml(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*YamlGenerator) GenerateLoggerYaml ¶ added in v0.0.5
func (g *YamlGenerator) GenerateLoggerYaml(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
func (*YamlGenerator) GenerateServerYaml ¶ added in v0.0.5
func (g *YamlGenerator) GenerateServerYaml(ctx context.Context, opts code_generator.Options) (outputPath string, err error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.