Documentation ¶
Index ¶
- Variables
- func FindModuleRoot(dir string) (roots string)
- func GetInterface(modulePath string, moduleName string, methodName string) (interfaceFullName string, newMethod string, returnDefaultValues string, ...)
- func GetModuleInfo(modulePath string) (string, string, error)
- func GetModulePath() string
- func HandlePromptError(err error) bool
- func InteractiveRun()
- func IsInterruptError(err error) bool
- func IsValidError(err error) bool
- type Config
- type SubModule
- type ValidError
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func FindModuleRoot ¶
func GetInterface ¶
func GetModulePath ¶
func GetModulePath() string
func HandlePromptError ¶
HandlePromptError the return value indicates whether the for loop needs to be executed
func InteractiveRun ¶
func InteractiveRun()
InteractiveRun Tips: Before running, you should stash all changes for avoiding the wrong generation code 1. Get module info 2. Scan the module 3. Choose the interface 4. Add a new method 5. Add default return values 6. Choose the struct file or some struct can be ignored choose the other interface
func IsInterruptError ¶
func IsValidError ¶
Types ¶
type Config ¶
type Config struct { WritePaths []string `yaml:"write_paths,flow"` ExcludeDirs []string `yaml:"exclude_dirs,flow"` ProjectDir string `yaml:"project_dir"` ProjectModule string `yaml:"project_module"` InterfaceFullName string `yaml:"interface_full_name"` NewMethod string `yaml:"new_method"` ReturnDefaultValues string `yaml:"return_default_values"` IgnoreStructs []string `yaml:"ignore_structs,flow"` EnableRecord bool `yaml:"enable_record"` EnableDebug bool `yaml:"enable_debug"` SubModules []SubModule `yaml:"sub_modules,flow"` }
type ValidError ¶
type ValidError struct {
// contains filtered or unexported fields
}
func NewValidErrorFromError ¶
func NewValidErrorFromError(err error) *ValidError
func NewValidErrorFromString ¶
func NewValidErrorFromString(msg string) *ValidError
Click to show internal directories.
Click to hide internal directories.