Documentation
¶
Index ¶
- Constants
- func Category() string
- func Clean() error
- func GenTemplates(_ *cli.Context) error
- func NewDefaultGenerator(dir, proto, ppack string, cfg *config.Config, opt ...Option) (*defaultGenerator, error)
- func RevertTemplate(name string) error
- func Update() error
- func UpdateUpper(a string) string
- type Join
- type Key
- type Option
- type PgTable
- type Table
Constants ¶
View Source
const (
Factory = "factory"
)
Variables ¶
This section is empty.
Functions ¶
func GenTemplates ¶
GenTemplates creates template files if not exists
func NewDefaultGenerator ¶
func NewDefaultGenerator(dir, proto, ppack string, cfg *config.Config, opt ...Option) (*defaultGenerator, error)
NewDefaultGenerator creates an instance for defaultGenerator
func RevertTemplate ¶
RevertTemplate recovers the delete template files
func UpdateUpper ¶
Types ¶
type Key ¶
type Key struct {
// VarLeft describes the variable of cache key expression which likes cacheUserIdPrefix
VarLeft string
// VarRight describes the value of cache key expression which likes "cache#user#id#"
VarRight string
// VarExpression describes the cache key expression which likes cacheUserIdPrefix = "cache#user#id#"
VarExpression string
// KeyLeft describes the variable of key definition expression which likes userKey
KeyLeft string
// KeyRight describes the value of key definition expression which likes fmt.Sprintf("%s%v", cacheUserPrefix, user)
KeyRight string
// DataKeyRight describes data key likes fmt.Sprintf("%s%v", cacheUserPrefix, data.User)
DataKeyRight string
// KeyExpression describes key expression likes userKey := fmt.Sprintf("%s%v", cacheUserPrefix, user)
KeyExpression string
// DataKeyExpression describes data key expression likes userKey := fmt.Sprintf("%s%v", cacheUserPrefix, data.User)
DataKeyExpression string
// FieldNameJoin describes the filed slice of table
FieldNameJoin Join
// Fields describes the fields of table
Fields []*parser.Field
}
Key describes cache key
type Option ¶
type Option func(generator *defaultGenerator)
Option defines a function with argument defaultGenerator
func WithConsoleOption ¶
WithConsoleOption creates a console option
Click to show internal directories.
Click to hide internal directories.