Documentation ¶
Index ¶
- Constants
- Variables
- func KebabCase(name string) string
- func SnakeCase(name string) string
- type Directive
- type GenSet
- type GenType
- type Options
- type Setting
- func (s *Setting) HasDirective(doc, directive string) (string, bool)
- func (s *Setting) HasPrefix(path, layout string) bool
- func (s *Setting) IsController(path string) bool
- func (s *Setting) IsIteration(path string) bool
- func (s *Setting) IsQuery(path string) bool
- func (s *Setting) IsRepository(path string) bool
- func (s *Setting) IsService(path string) bool
- func (s *Setting) ParseDirectiveGen(doc string) (*GenSet, error)
- func (s *Setting) SourceFile(srcname string) string
- func (s *Setting) TargetFile(srcname string, replName ...string) string
- func (s *Setting) TmplFile(path ...string) string
- type TmplType
Constants ¶
View Source
const ( // go files GoMainFileTmpl = "main.go.tmpl" GoMainFile = "main.go" GoFileSuffix = ".go" ConfigFile = "config.yml" // Iteration IterationFileTmpl = "iteration" // template InternalTmplDir = "templates" SyncDir = "sync" // directive DirectiveSync Directive = "ardan:sync" DirectiveGen Directive = "ardan:gen" )
Variables ¶
View Source
var ( ErrDirectiveNone = errors.New("Directive is none") ErrFilenameNone = errors.New("Filename is null") )
Functions ¶
Types ¶
type Options ¶
type Options struct { TmplDir string OutputDir string FuncMap template.FuncMap DBDriver string // database driver name DBName string // database name DBConnStr string // database connection string GoModName string Config string // config file // project layout CmdDir string // command root directory DocDir string // documents root directory AppDir string // application layer directory ModelDir string // domain layer directory ServiceDir string // service layer directory RepositoryDir string // repository layer directory ServerDir string // server layer directory ServerModuleDir string // server module directory ServerGlobalDir string // server global directory ControllerDir string // controller directory HandlerDir string // handler directory MiddlewareDir string // middleware directory Sample bool }
Options setting options
type Setting ¶
type Setting struct { Template *template.Template FileSystem http.FileSystem Origins []string // origin files Layouts []string // project layout dir names Codes []string // source code names Gens []string // gen code names Samples []string // sample names DBDriver string // database driver name DBName string // database name DBConnStr string // database connection string GoMod string // layout InternalTmplDir string // internal template dir TmplDir string // template dir Output string // output root dir Cmd string // cmd dir Sync string // sync dir Doc string // documents root directory App string // application dir Model string // domain layer directory Query string // domain layer query directory Service string // service layer directory Repository string // repository layer directory Server string // server layer directory ServerModule string // server module directory ServerGlobal string // server global directory Controller string // controller directory Handler string // handler directory Middleware string // middleware directory Sample bool }
func (*Setting) HasDirective ¶ added in v0.1.9
func (*Setting) IsController ¶ added in v0.2.0
func (*Setting) IsIteration ¶ added in v0.2.0
func (*Setting) IsRepository ¶ added in v0.2.0
func (*Setting) ParseDirectiveGen ¶ added in v0.2.0
func (*Setting) SourceFile ¶ added in v0.1.7
func (*Setting) TargetFile ¶
Click to show internal directories.
Click to hide internal directories.