Documentation ¶
Index ¶
- Variables
- func EachFieldValue(val reflect.Value, walker func(value reflect.Value) bool)
- func Generate(generator Generator, inputPath, outputPath string)
- func GeneratedSuffix(filename string) string
- func GetServiceName(projectName string) string
- func IsGoFile(filename string) bool
- func IsGoTextFile(filename string) bool
- func ParseStatusErrorDesc(str string) (msg string, desc string, canBeErrTalk bool)
- func PathExist(p string) bool
- func WriteFile(filename string, content string)
- type ClientGenerator
- type Config
- type ControllerGenerator
- type DockerGenerator
- type EnumGenerator
- type Generator
- type K8sGenerator
- type ModelGenerator
- type OpenApiGenerator
- func (a *OpenApiGenerator) Finally()
- func (a *OpenApiGenerator) Load(cwd string)
- func (a *OpenApiGenerator) OperationByOperatorTypes(method string, operatorTypes ...*scanner.OperatorWithTypeName) *oas.Operation
- func (a *OpenApiGenerator) Output(outputPath string) Outputs
- func (a *OpenApiGenerator) Pick()
- type Outputs
- type PluginDetail
- type ProjectGenerator
- type ProjectOption
- type RouterGenerator
- type ServiceGenerator
- type ServiceOption
- type StatusErrGenerator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Image = files.EnvVar(internal.DockerRegistry) + "/${PROJECT_GROUP}/${PROJECT_NAME}:${PROJECT_VERSION}" FromImage = files.EnvVar(internal.DockerRegistry) + "/" + files.EnvVar(internal.RunnerGolang) )
Functions ¶
func GeneratedSuffix ¶
func GetServiceName ¶
func IsGoTextFile ¶
func ParseStatusErrorDesc ¶
Types ¶
type ClientGenerator ¶
func NewClientGenerator ¶
func NewClientGenerator(pkgName string) *ClientGenerator
func (*ClientGenerator) Finally ¶
func (c *ClientGenerator) Finally()
func (*ClientGenerator) Load ¶
func (c *ClientGenerator) Load(path string)
func (*ClientGenerator) Output ¶
func (c *ClientGenerator) Output(outputPath string) Outputs
func (*ClientGenerator) Pick ¶
func (c *ClientGenerator) Pick()
type Config ¶
type Config struct { StructName string TableName string Database string WithComments bool WithTableName bool WithTableInterfaces bool WithMethods bool FieldPrimaryKey string FieldKeyDeletedAt string FieldKeyCreatedAt string FieldKeyUpdatedAt string }
func (*Config) SetDefaults ¶
func (g *Config) SetDefaults()
type ControllerGenerator ¶ added in v1.3.1
type ControllerGenerator struct { scanner.ModelScannerConfig // contains filtered or unexported fields }
func NewControllerGenerator ¶ added in v1.3.1
func NewControllerGenerator() *ControllerGenerator
func (*ControllerGenerator) Finally ¶ added in v1.3.1
func (g *ControllerGenerator) Finally()
func (*ControllerGenerator) Load ¶ added in v1.3.1
func (g *ControllerGenerator) Load(cwd string)
func (*ControllerGenerator) Output ¶ added in v1.3.1
func (g *ControllerGenerator) Output(outputPath string) Outputs
func (*ControllerGenerator) Pick ¶ added in v1.3.1
func (g *ControllerGenerator) Pick()
type DockerGenerator ¶
func NewDockerGenerator ¶
func NewDockerGenerator(serviceName string, envVars []envconfig.EnvVar) *DockerGenerator
func (*DockerGenerator) Finally ¶
func (d *DockerGenerator) Finally()
func (*DockerGenerator) Load ¶
func (d *DockerGenerator) Load(path string)
func (*DockerGenerator) Output ¶
func (d *DockerGenerator) Output(outputPath string) Outputs
func (*DockerGenerator) Pick ¶
func (d *DockerGenerator) Pick()
type EnumGenerator ¶
type EnumGenerator struct { TypeName string // contains filtered or unexported fields }
func NewEnumGenerator ¶
func NewEnumGenerator(typeName string) *EnumGenerator
func (*EnumGenerator) Finally ¶
func (e *EnumGenerator) Finally()
func (*EnumGenerator) Load ¶
func (e *EnumGenerator) Load(cwd string)
func (*EnumGenerator) Output ¶
func (e *EnumGenerator) Output(outputPath string) Outputs
func (*EnumGenerator) Pick ¶
func (e *EnumGenerator) Pick()
type K8sGenerator ¶
type K8sGenerator struct {
// contains filtered or unexported fields
}
func NewK8sGenerator ¶
func NewK8sGenerator(config []interface{}) *K8sGenerator
func (*K8sGenerator) Finally ¶
func (d *K8sGenerator) Finally()
func (*K8sGenerator) Load ¶
func (d *K8sGenerator) Load(cwd string)
func (*K8sGenerator) Output ¶
func (d *K8sGenerator) Output(outputPath string) Outputs
func (*K8sGenerator) Pick ¶
func (d *K8sGenerator) Pick()
type ModelGenerator ¶
func NewModelGenerator ¶
func NewModelGenerator() *ModelGenerator
func (*ModelGenerator) Finally ¶
func (g *ModelGenerator) Finally()
func (*ModelGenerator) Load ¶
func (g *ModelGenerator) Load(cwd string)
func (*ModelGenerator) Output ¶
func (g *ModelGenerator) Output(outputPath string) Outputs
func (*ModelGenerator) Pick ¶
func (g *ModelGenerator) Pick()
type OpenApiGenerator ¶
type OpenApiGenerator struct {
// contains filtered or unexported fields
}
func NewOpenApiGenerator ¶
func NewOpenApiGenerator() *OpenApiGenerator
func (*OpenApiGenerator) Finally ¶
func (a *OpenApiGenerator) Finally()
func (*OpenApiGenerator) Load ¶
func (a *OpenApiGenerator) Load(cwd string)
func (*OpenApiGenerator) OperationByOperatorTypes ¶
func (a *OpenApiGenerator) OperationByOperatorTypes(method string, operatorTypes ...*scanner.OperatorWithTypeName) *oas.Operation
func (*OpenApiGenerator) Output ¶
func (a *OpenApiGenerator) Output(outputPath string) Outputs
func (*OpenApiGenerator) Pick ¶
func (a *OpenApiGenerator) Pick()
type Outputs ¶
func (Outputs) WriteFiles ¶
func (outputs Outputs) WriteFiles()
type PluginDetail ¶
type ProjectGenerator ¶
type ProjectGenerator struct {
// contains filtered or unexported fields
}
func NewProjectGenerator ¶
func NewProjectGenerator(opt ProjectOption) *ProjectGenerator
func (*ProjectGenerator) Finally ¶
func (p *ProjectGenerator) Finally()
func (*ProjectGenerator) Load ¶
func (p *ProjectGenerator) Load(path string)
func (*ProjectGenerator) Output ¶
func (p *ProjectGenerator) Output(outputPath string) Outputs
func (*ProjectGenerator) Pick ¶
func (p *ProjectGenerator) Pick()
type ProjectOption ¶
type RouterGenerator ¶ added in v1.3.1
type RouterGenerator struct { scanner.ModelScannerConfig // contains filtered or unexported fields }
func NewRouterGenerator ¶ added in v1.3.1
func NewRouterGenerator() *RouterGenerator
func (*RouterGenerator) Finally ¶ added in v1.3.1
func (g *RouterGenerator) Finally()
func (*RouterGenerator) Load ¶ added in v1.3.1
func (g *RouterGenerator) Load(cwd string)
func (*RouterGenerator) Output ¶ added in v1.3.1
func (g *RouterGenerator) Output(outputPath string) Outputs
func (*RouterGenerator) Pick ¶ added in v1.3.1
func (g *RouterGenerator) Pick()
type ServiceGenerator ¶
type ServiceGenerator struct {
// contains filtered or unexported fields
}
func NewServiceGenerator ¶
func NewServiceGenerator(opt ServiceOption) *ServiceGenerator
func (*ServiceGenerator) Finally ¶
func (s *ServiceGenerator) Finally()
func (*ServiceGenerator) Load ¶
func (s *ServiceGenerator) Load(path string)
func (*ServiceGenerator) Output ¶
func (s *ServiceGenerator) Output(outputPath string) Outputs
func (*ServiceGenerator) Pick ¶
func (s *ServiceGenerator) Pick()
type ServiceOption ¶
type ServiceOption struct { FrameworkVersion string `survey:"framework_version"` Name string PackageName string `survey:"package_name"` DatabaseSupport expressBool `survey:"database_support"` ApolloSupport expressBool `survey:"apollo_support"` Plugins []string PluginDetails []PluginDetail `survey:"-"` Group string Owner string Desc string Version string ProgramLanguage string `survey:"project_language"` Workflow string }
func (ServiceOption) GetPluginDetailByPackageName ¶
func (opt ServiceOption) GetPluginDetailByPackageName(pkgName string) *PluginDetail
type StatusErrGenerator ¶
type StatusErrGenerator struct {
// contains filtered or unexported fields
}
func NewStatusErrGenerator ¶
func NewStatusErrGenerator() *StatusErrGenerator
func (*StatusErrGenerator) Finally ¶
func (s *StatusErrGenerator) Finally()
func (*StatusErrGenerator) Load ¶
func (s *StatusErrGenerator) Load(path string)
func (*StatusErrGenerator) Output ¶
func (s *StatusErrGenerator) Output(outputPath string) Outputs
func (*StatusErrGenerator) Pick ¶
func (s *StatusErrGenerator) Pick()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.