Documentation
¶
Index ¶
- Constants
- func CreateConfig(optsArr ...ConfigOptions) (*viper.Viper, error)
- func CreateDir(path string) error
- func CreateFile(path string) (*os.File, error)
- func CreateFunc(file *ast.File, name string, params *ast.FieldList, content *ast.BlockStmt)
- func CreateFunction(file *ast.File, name string, content *ast.BlockStmt)
- func DefaultErrorHandler(err error) error
- func Exists(path string) (isDir bool, exists bool, err error)
- func FindPIDByPort(port string) (string, error)
- func GenerateFromTemplate(templatePath string, outPath string, params map[string]string) error
- func GenerateFromTemplateFile(templateContent, outPath string, params map[string]string) error
- func GenerateUUID() string
- func GetModuleFullPath(module string) (string, error)
- func GetModuleName() (string, error)
- func GetModulePath() (string, error)
- func KillProcess(pid string) error
- func NewApp() *fiber.App
- func OnlyCreateFile(path string) error
- func ParseFile(filePath string) (node *ast.File, fset *token.FileSet, err error)
- func Raise[T any](res T, err error) T
- func RaiseVoid(err error)
- func SetMode(mode ENV_MODE)
- func StartApp(app *fiber.App)
- func Throw(err error)
- func TryCatch[T any](fn func() T, errHandler ErrorHandler) (res T, err error)
- func TryCatchVoid(fn func(), errHandler ErrorHandler) error
- func UpperCamelCase(s string) string
- func WriteToFile(file *ast.File, filePath string) error
- func WriteToFileByFset(fset *token.FileSet, file *ast.File, filePath string) error
- type BaseEntity
- type BaseEntityWithID
- type BaseEntityWithUuid
- type Config
- type ConfigInterface
- type ConfigOptions
- type ENV_MODE
- type ErrorHandler
- type MatchType
- type Route
- type SearchResult
Constants ¶
View Source
const ENV_MODE_KEY = "JSON_ENV_MODE"
Variables ¶
This section is empty.
Functions ¶
func CreateConfig ¶
func CreateConfig(optsArr ...ConfigOptions) (*viper.Viper, error)
func CreateFunc ¶
func DefaultErrorHandler ¶
func FindPIDByPort ¶
func GenerateFromTemplate ¶
func GenerateUUID ¶
func GenerateUUID() string
func GetModuleFullPath ¶
func GetModuleName ¶
func GetModulePath ¶
func KillProcess ¶
func OnlyCreateFile ¶
func TryCatch ¶
func TryCatch[T any](fn func() T, errHandler ErrorHandler) (res T, err error)
func TryCatchVoid ¶
func TryCatchVoid(fn func(), errHandler ErrorHandler) error
func UpperCamelCase ¶
Types ¶
type BaseEntity ¶
type BaseEntityWithID ¶
type BaseEntityWithID struct { ID uint `json:"id" gorm:"primarykey"` BaseEntity }
type BaseEntityWithUuid ¶
type BaseEntityWithUuid struct { ID string `json:"id" gorm:"primarykey;type:char(20)" json:"id"` BaseEntity }
func (*BaseEntityWithUuid) BeforeCreate ¶
func (e *BaseEntityWithUuid) BeforeCreate() error
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewConfig ¶
func NewConfig(optsArr ...ConfigOptions) (*Config, error)
type ConfigInterface ¶
type ConfigOptions ¶
type ConfigOptions struct { BasePath string FileName string FileType string WatchAble bool OnChange func(e fsnotify.Event) }
func DefaultConfigOptions ¶
func DefaultConfigOptions() ConfigOptions
type ErrorHandler ¶
type SearchResult ¶
func FindFunctions ¶
FindFunctions 查找函数定义
func FindInterfaces ¶
func FindInterfaces(filePath string, pattern string, matchType MatchType) ([]SearchResult, error)
FindInterfaces 查找接口定义
func FindStructs ¶
func FindStructs(filePath string, pattern string, matchType MatchType) ([]SearchResult, error)
FindStructs 查找结构体定义
Source Files
¶
Click to show internal directories.
Click to hide internal directories.