Documentation
¶
Index ¶
- func BuildTemplateData(cfg ComponentConfig) map[string]any
- func Capitalize(s string) string
- func DetectProjectProfile() (*detector.ProjectProfile, error)
- func DetectProjectProfileWithRefresh(forceRefresh bool) (*detector.ProjectProfile, error)
- func FindSourcePath(startDir string) string
- func FindTestPath(startDir string) string
- func FormatRelativePath(base, path string) string
- func GenerateComponent(cfg ComponentConfig, templateName, subPackage, fileNamePattern string) (bool, error)
- func GetTemplateDir(profile *detector.ProjectProfile) string
- func GetTestTemplateDir(profile *detector.ProjectProfile) string
- func IsUpper(r rune) bool
- func NewCommand() *cobra.Command
- func OutputGenerateResult(jsonOutput bool, tracker *GenerateTracker) error
- func SplitWords(s string) []string
- func ToCamelCase(s string) string
- func ToPascalCase(s string) string
- func ValidateComponentConfig(cfg ComponentConfig) error
- func ValidateComponentName(name string) error
- func ValidatePackageName(pkg string) error
- type ComponentConfig
- type GenerateTracker
- type ResourceConfig
- type SecurityType
- type TemplateContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTemplateData ¶ added in v0.1.4
func BuildTemplateData(cfg ComponentConfig) map[string]any
func Capitalize ¶ added in v0.1.4
func DetectProjectProfile ¶ added in v0.1.7
func DetectProjectProfile() (*detector.ProjectProfile, error)
func DetectProjectProfileWithRefresh ¶ added in v0.1.7
func DetectProjectProfileWithRefresh(forceRefresh bool) (*detector.ProjectProfile, error)
func FindSourcePath ¶ added in v0.1.4
func FindTestPath ¶ added in v0.1.7
func FormatRelativePath ¶ added in v0.1.4
func GenerateComponent ¶ added in v0.1.4
func GenerateComponent(cfg ComponentConfig, templateName, subPackage, fileNamePattern string) (bool, error)
func GetTemplateDir ¶ added in v0.1.7
func GetTemplateDir(profile *detector.ProjectProfile) string
func GetTestTemplateDir ¶ added in v0.1.7
func GetTestTemplateDir(profile *detector.ProjectProfile) string
func NewCommand ¶
func OutputGenerateResult ¶ added in v0.1.9
func OutputGenerateResult(jsonOutput bool, tracker *GenerateTracker) error
func SplitWords ¶ added in v0.1.4
func ToCamelCase ¶ added in v0.1.4
func ToPascalCase ¶ added in v0.1.4
func ValidateComponentConfig ¶ added in v0.1.4
func ValidateComponentConfig(cfg ComponentConfig) error
func ValidateComponentName ¶ added in v0.1.4
func ValidatePackageName ¶ added in v0.1.4
Types ¶
type ComponentConfig ¶ added in v0.1.4
type ComponentConfig struct {
Name string
BasePackage string
HasLombok bool
HasJpa bool
HasValidation bool
}
func DetectProjectConfig ¶ added in v0.1.4
func DetectProjectConfig() (ComponentConfig, error)
func RunComponentWizard ¶ added in v0.1.4
func RunComponentWizard(title string, cfg ComponentConfig, componentType string) (ComponentConfig, error)
type GenerateTracker ¶ added in v0.1.9
type GenerateTracker struct {
Type string
Name string
Generated []string
Skipped []string
Errors []string
}
func NewGenerateTracker ¶ added in v0.1.9
func NewGenerateTracker(componentType, name string) *GenerateTracker
func (*GenerateTracker) AddError ¶ added in v0.1.9
func (t *GenerateTracker) AddError(err string)
func (*GenerateTracker) AddGenerated ¶ added in v0.1.9
func (t *GenerateTracker) AddGenerated(file string)
func (*GenerateTracker) AddSkipped ¶ added in v0.1.9
func (t *GenerateTracker) AddSkipped(file string)
func (*GenerateTracker) ToOutput ¶ added in v0.1.9
func (t *GenerateTracker) ToOutput() output.GenerateResult
type ResourceConfig ¶
type SecurityType ¶ added in v0.1.9
type SecurityType string
const ( SecurityJWT SecurityType = "jwt" SecuritySession SecurityType = "session" SecurityOAuth2 SecurityType = "oauth2" )
type TemplateContext ¶ added in v0.1.7
type TemplateContext struct {
Name string
NameLower string
NameCamel string
BasePackage string
FeaturePackage string
TestPackage string
Architecture string
FeatureStyleFlat bool
HasLombok bool
HasJpa bool
HasValidation bool
HasSwagger bool
HasMapStruct bool
IDType string
IDImport string
TestIdValue string
ControllerSuffix string
RequestSuffix string
ResponseSuffix string
HasBaseEntity bool
BaseEntityName string
BaseEntityImport string
HasResponseWrapper bool
ResponseWrapperName string
ResponseWrapperImport string
HasGlobalException bool
ExceptionPackage string
ValidationImport string
Lombok detector.LombokProfile
}
func BuildTemplateContextFromProfile ¶ added in v0.1.7
func BuildTemplateContextFromProfile(name string, profile *detector.ProjectProfile) TemplateContext
func (TemplateContext) ToMap ¶ added in v0.1.7
func (ctx TemplateContext) ToMap() map[string]any
Click to show internal directories.
Click to hide internal directories.