Documentation
¶
Index ¶
- func Generate(ctx context.Context, opts GeneratorOptions) error
- type Generator
- func (g *Generator) Generate(ctx context.Context, opts GeneratorOptions) error
- func (g *Generator) WriteDataPackageCode(outputPath string, orm string, projectName string, serviceName string, ...) error
- func (g *Generator) WriteMainCode(outputPath string, projectName string, serviceName string, servers []string) error
- func (g *Generator) WriteServerPackageCode(outputPath string, projectName string, serviceType string, serviceName string, ...) error
- func (g *Generator) WriteServicePackageCode(outputPath string, projectName string, serviceName string, name string, ...) error
- func (g *Generator) WriteWireCode(outputPath string, projectName string, serviceName string) error
- func (g *Generator) WriteWireSetCode(outputPath string, projectModule string, serviceName string, ...) error
- type GeneratorOption
- func WithExcludedTables(tables []string) GeneratorOption
- func WithIncludedTables(tables []string) GeneratorOption
- func WithModuleName(name string) GeneratorOption
- func WithModuleVersion(ver string) GeneratorOption
- func WithOutputPath(path string) GeneratorOption
- func WithSource(dsn string) GeneratorOption
- func WithSourceModuleName(name string) GeneratorOption
- type GeneratorOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Generator ¶ added in v0.0.5
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶ added in v0.0.5
func NewGenerator() *Generator
func (*Generator) Generate ¶ added in v0.0.5
func (g *Generator) Generate(ctx context.Context, opts GeneratorOptions) error
func (*Generator) WriteDataPackageCode ¶ added in v0.0.5
func (*Generator) WriteMainCode ¶ added in v0.0.5
func (*Generator) WriteServerPackageCode ¶ added in v0.0.5
func (*Generator) WriteServicePackageCode ¶ added in v0.0.5
func (*Generator) WriteWireCode ¶ added in v0.0.5
type GeneratorOption ¶ added in v0.0.4
type GeneratorOption func(*GeneratorOptions)
func WithExcludedTables ¶ added in v0.0.4
func WithExcludedTables(tables []string) GeneratorOption
func WithIncludedTables ¶ added in v0.0.4
func WithIncludedTables(tables []string) GeneratorOption
func WithModuleName ¶ added in v0.0.4
func WithModuleName(name string) GeneratorOption
func WithModuleVersion ¶ added in v0.0.4
func WithModuleVersion(ver string) GeneratorOption
func WithOutputPath ¶ added in v0.0.4
func WithOutputPath(path string) GeneratorOption
func WithSource ¶ added in v0.0.4
func WithSource(dsn string) GeneratorOption
func WithSourceModuleName ¶ added in v0.0.4
func WithSourceModuleName(name string) GeneratorOption
type GeneratorOptions ¶ added in v0.0.4
type GeneratorOptions struct {
Driver string
Source string // Data Source name (DSN), e.g., "mysql://user:pass@tcp(localhost:3306)/dbname"
IncludedTables []string
ExcludedTables []string
OutputPath string
SourceModuleName string // for REST service, the Source module name
ModuleName string
ModuleVersion string
OrmType string // ORM type, e.g., "gorm", "sqlx", "ent"
ProjectName string
ServiceName string
Servers []string
UseRepo bool
GenerateProto bool
GenerateServer bool
GenerateService bool
GenerateORM bool
GenerateData bool
GenerateMain bool
}
Click to show internal directories.
Click to hide internal directories.