Documentation ¶
Index ¶
- Variables
- func DbToGoType(colType string) string
- func ToStringSlice(val []interface{}) (result []string)
- type Field
- func (f *Field) BJTag() string
- func (f *Field) Foreign() string
- func (f *Field) ForeignType() string
- func (f *Field) GetGoType() string
- func (f *Field) GetNullSQLType() string
- func (f *Field) GetThriftType() string
- func (f *Field) HasBindData() bool
- func (f *Field) HasDefaultValue() bool
- func (f *Field) HasDisable() bool
- func (f *Field) HasEnums() bool
- func (f *Field) HasForeign() bool
- func (f *Field) HasHidden() bool
- func (f *Field) HasIndex() bool
- func (f *Field) HasMeta() bool
- func (f *Field) HasReadOnly() bool
- func (f *Field) HasRule() bool
- func (f *Field) HasStringList() bool
- func (f *Field) IsNullable() bool
- func (f *Field) IsNullablePrimitive() bool
- func (f *Field) IsRequired() bool
- func (f *Field) IsUnique() bool
- func (f *Field) NullSQLTypeNeedCast() bool
- func (f *Field) NullSQLTypeValue() string
- func (f *Field) Read(data map[interface{}]interface{}) error
- type Index
- type ListedField
- type Obj
- func (o *Obj) GetConfigTemplate() (string, bool)
- func (o *Obj) GetFieldNames() []string
- func (o *Obj) GetFilterFields() []*Field
- func (o *Obj) GetFormImports() (imports []string)
- func (o *Obj) GetGenTypes() []string
- func (o *Obj) GetListedFields() []*ListedField
- func (o *Obj) GetNonIDFields() []*Field
- func (o *Obj) GetNonIdFieldNames() []string
- func (o *Obj) GetOrmImports() (imports []string)
- func (o *Obj) GetStringFilterFields() []*Field
- func (o *Obj) GetTimeFields() []*Field
- func (o *Obj) HasTimeFields() bool
- func (o *Obj) LoadField(f *Field) string
- func (o *Obj) LoadTpl(tpl string) string
- func (o *Obj) NeedIndex() bool
- func (o *Obj) NeedMapping() bool
- func (o *Obj) NeedOrm() bool
- func (o *Obj) NeedSearch() bool
- func (o *Obj) Read(data map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var NullTypes = map[string]string{
"string": "String",
"bool": "Bool",
"int": "Int64",
"int32": "Int64",
"int64": "Int64",
"bit": "Bool",
"time.Time": "String",
"float": "Float64",
"float32": "Float64",
"float64": "Float64",
}
View Source
var SupportedFieldTypes = map[string]string{
"[]string": "list<string>",
"bool": "bool",
"datetime": "i64",
"float64": "double",
"int": "i32",
"int32": "i32",
"int64": "i64",
"string": "string",
}
View Source
var Tpl *template.Template
Functions ¶
func DbToGoType ¶
func ToStringSlice ¶
func ToStringSlice(val []interface{}) (result []string)
Types ¶
type Field ¶
type Field struct { Attrs map[string]string DefaultValue string Flags set.Set Index string Key string Label string PlaceHolder string Name string Order string Tag string Type string Widget string Remark string FK string Obj *Obj }
func (*Field) ForeignType ¶
func (*Field) GetNullSQLType ¶
func (*Field) GetThriftType ¶
func (*Field) HasBindData ¶
func (*Field) HasDefaultValue ¶
func (*Field) HasDisable ¶
func (*Field) HasForeign ¶
func (*Field) HasReadOnly ¶
func (*Field) HasStringList ¶
func (*Field) IsNullable ¶
func (*Field) IsNullablePrimitive ¶
func (*Field) IsRequired ¶
func (*Field) NullSQLTypeNeedCast ¶
func (*Field) NullSQLTypeValue ¶
type Index ¶
func (*Index) GetFieldList ¶
func (*Index) GetFuncParam ¶
func (*Index) GetFuncParamNames ¶
type ListedField ¶
type Obj ¶
type Obj struct { Db string Extend string Fields []*Field FieldNameMap map[string]*Field FilterFields []string Indexes []*Index Name string Package string SearchIndex string SearchType string Table string TplWriter io.Writer DbName string }
func (*Obj) GetConfigTemplate ¶
func (*Obj) GetFieldNames ¶
func (*Obj) GetFilterFields ¶
func (*Obj) GetFormImports ¶
func (*Obj) GetGenTypes ¶
func (*Obj) GetListedFields ¶
func (o *Obj) GetListedFields() []*ListedField
func (*Obj) GetNonIDFields ¶
func (*Obj) GetNonIdFieldNames ¶
func (*Obj) GetOrmImports ¶
func (*Obj) GetStringFilterFields ¶
func (*Obj) GetTimeFields ¶
func (*Obj) HasTimeFields ¶
func (*Obj) NeedMapping ¶
func (*Obj) NeedSearch ¶
Click to show internal directories.
Click to hide internal directories.