Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LangTmpl ¶
type LangTmpl struct { Funcs template.FuncMap Formater func(string) (string, error) GenImports func([]*schemas.Table) map[string]string }
var ( GoLangTmpl LangTmpl = LangTmpl{ template.FuncMap{"Mapper": mapper.Table2Obj, "Type": typestring, "Tag": tag, "UnTitle": unTitle, "gt": gt, "getCol": getCol, "genParams": func(v ...interface{}) (ret interface{}, err error) { col := v[1].([]string) str := make([]string, 0) for _, c := range col { if v[2].(bool) { str = append(str, "m"+mapper.Table2Obj(c)+" torm.Param") } else { str = append(str, "m"+mapper.Table2Obj(c)) } } return strings.Join(str, ","), nil }, "getMethodName": func(v ...interface{}) (ret interface{}, err error) { col := v[0].(string) cols := strings.Split(col, "_") str := "" for _, c := range cols { str = str + mapper.Table2Obj(c) } return str, nil }, }, formatGo, genGoImports, } )
type Reverse ¶
type Reverse struct {
// contains filtered or unexported fields
}
func NewReverse ¶
func NewReverse(option ...ReverseOption) *Reverse
type ReverseOption ¶
func SetReverseSingle ¶
func SetReverseSingle(s bool) ReverseOption
func SetReverseTmplPath ¶
func SetReverseTmplPath(path string) ReverseOption
Click to show internal directories.
Click to hide internal directories.