Documentation
¶
Index ¶
- Variables
- func Camel2Name(s string) string
- func ToIds(bufName, typeName, name string) string
- type ESIndex
- type Field
- func (f *Field) ColumnName() string
- func (f *Field) FieldName() string
- func (f *Field) GetNullSQLType() string
- func (f *Field) GetTag() string
- func (f *Field) GetTransform() *Transform
- func (f *Field) GetTransformValue(prefix string) string
- func (f *Field) GetType() string
- func (f *Field) HasIndex() bool
- func (f *Field) IsAutoIncrement() bool
- func (f *Field) IsEncode() bool
- func (f *Field) IsFullText() bool
- func (f *Field) IsIndex() bool
- func (f *Field) IsNeedTransform() bool
- func (f *Field) IsNullable() bool
- func (f *Field) IsNullablePrimitive() bool
- func (f *Field) IsNumber() bool
- func (f *Field) IsPrimary() bool
- func (f *Field) IsRange() bool
- func (f *Field) IsString() bool
- func (f *Field) IsTime() 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
- func (f *Field) SQLColumn(driver string) string
- func (f *Field) SQLDefault(driver string) string
- func (f *Field) SQLName(driver string) string
- func (f *Field) SQLNull(driver string) string
- func (f *Field) SQLType(driver string) string
- func (f *Field) SetType(t string) error
- type Index
- type IndexArray
- type MetaObject
- func (m *MetaObject) Comment() string
- func (o *MetaObject) DbContains(db string) bool
- func (o *MetaObject) DbSource() string
- func (m *MetaObject) ElasticIndexTypeName() string
- func (o *MetaObject) FieldByName(name string) *Field
- func (o *MetaObject) Fields() []*Field
- func (o *MetaObject) FromDB() string
- func (o *MetaObject) Indexes() []*Index
- func (o *MetaObject) LastField() *Field
- func (o *MetaObject) NoneIncrementFields() []*Field
- func (o *MetaObject) PrimaryField() *Field
- func (o *MetaObject) PrimaryKey() *PrimaryKey
- func (o *MetaObject) Ranges() []*Index
- func (o *MetaObject) Read(name string, data map[string]interface{}) error
- func (o *MetaObject) Uniques() []*Index
- type PrimaryKey
- type Relation
- type TplESIndexMappingField
- type Transform
Constants ¶
This section is empty.
Variables ¶
View Source
var ESAnalyzableFields = map[string]bool{ "string": true, }
View Source
var SupportedESFieldTypes = map[string]string{
"bool": "boolean",
"int": "integer",
"int8": "byte",
"int16": "short",
"int32": "integer",
"int64": "long",
"float32": "float",
"float64": "double",
"string": "string",
"datetime": "date",
"timestamp": "date",
"timeint": "long",
}
View Source
var SupportedFieldTypes = map[string]string{
"bool": "bool",
"int": "int32",
"int8": "int8",
"int16": "int16",
"int32": "int32",
"int64": "int64",
"uint": "uint32",
"uint8": "uint8",
"uint16": "uint16",
"uint32": "uint32",
"uint64": "uint64",
"float32": "float32",
"float64": "float64",
"string": "string",
"datetime": "datetime",
"timestamp": "timestamp",
"timeint": "timeint",
}
Functions ¶
func Camel2Name ¶
//////////////////////////////////////////////////////////////////////
Types ¶
type ESIndex ¶
func (*ESIndex) ShouldAnalyze ¶
func (*ESIndex) ShouldIndex ¶
func (*ESIndex) TplMappingSettings ¶
func (e *ESIndex) TplMappingSettings() []TplESIndexMappingField
type Field ¶
type Field struct { Name string Type string Size int Flags orm.Set Attrs map[string]string Comment string Validator string Obj *MetaObject ESIndex ESIndex // contains filtered or unexported fields }
func (*Field) ColumnName ¶
func (*Field) GetNullSQLType ¶
func (*Field) GetTransform ¶
func (*Field) GetTransformValue ¶
func (*Field) IsAutoIncrement ¶
func (*Field) IsFullText ¶
func (*Field) IsNeedTransform ¶
func (*Field) IsNullable ¶
func (*Field) IsNullablePrimitive ¶
func (*Field) NullSQLTypeNeedCast ¶
func (*Field) NullSQLTypeValue ¶
func (*Field) SQLDefault ¶
type Index ¶
type Index struct { Name string Fields []*Field FieldNames []string Obj *MetaObject // contains filtered or unexported fields }
func NewIndex ¶
func NewIndex(obj *MetaObject) *Index
func (*Index) GetRelation ¶
func (*Index) HasPrimaryKey ¶
type IndexArray ¶
type IndexArray []*Index
func (IndexArray) Len ¶
func (a IndexArray) Len() int
func (IndexArray) Less ¶
func (a IndexArray) Less(i, j int) bool
func (IndexArray) Swap ¶
func (a IndexArray) Swap(i, j int)
type MetaObject ¶
type MetaObject struct { //! package name Package string GoPackage string //! model name Name string Tag string //! dbs Db string Dbs []string //! database DbName string DbTable string DbView string //! relation Relation *Relation //! importSQL ImportSQL string //! elastic ElasticIndexAll bool // contains filtered or unexported fields }
func NewMetaObject ¶
func NewMetaObject(packageName string) *MetaObject
func (*MetaObject) Comment ¶
func (m *MetaObject) Comment() string
func (*MetaObject) DbContains ¶
func (o *MetaObject) DbContains(db string) bool
func (*MetaObject) DbSource ¶
func (o *MetaObject) DbSource() string
func (*MetaObject) ElasticIndexTypeName ¶
func (m *MetaObject) ElasticIndexTypeName() string
func (*MetaObject) FieldByName ¶
func (o *MetaObject) FieldByName(name string) *Field
func (*MetaObject) Fields ¶
func (o *MetaObject) Fields() []*Field
func (*MetaObject) FromDB ¶
func (o *MetaObject) FromDB() string
func (*MetaObject) Indexes ¶
func (o *MetaObject) Indexes() []*Index
func (*MetaObject) LastField ¶
func (o *MetaObject) LastField() *Field
func (*MetaObject) NoneIncrementFields ¶
func (o *MetaObject) NoneIncrementFields() []*Field
func (*MetaObject) PrimaryField ¶
func (o *MetaObject) PrimaryField() *Field
func (*MetaObject) PrimaryKey ¶
func (o *MetaObject) PrimaryKey() *PrimaryKey
func (*MetaObject) Ranges ¶
func (o *MetaObject) Ranges() []*Index
func (*MetaObject) Uniques ¶
func (o *MetaObject) Uniques() []*Index
type PrimaryKey ¶
type PrimaryKey struct { Name string FieldNames []string Fields []*Field Obj *MetaObject }
func NewPrimaryKey ¶
func NewPrimaryKey(obj *MetaObject) *PrimaryKey
func (*PrimaryKey) FirstField ¶
func (pk *PrimaryKey) FirstField() *Field
func (*PrimaryKey) IsAutocrement ¶
func (pk *PrimaryKey) IsAutocrement() bool
func (*PrimaryKey) IsRange ¶
func (pk *PrimaryKey) IsRange() bool
func (*PrimaryKey) IsSingleField ¶
func (pk *PrimaryKey) IsSingleField() bool
func (*PrimaryKey) SQLColumn ¶
func (pk *PrimaryKey) SQLColumn(driver string) string
type Relation ¶
type Relation struct { Name string StoreType string ValueType string ModelType string ValueField *Field //! owner Obj *MetaObject // contains filtered or unexported fields }
func NewRelation ¶
func NewRelation(obj *MetaObject) *Relation
func (*Relation) NoneIncrementFields ¶
func (*Relation) PrimaryField ¶
func (*Relation) PrimaryKey ¶
func (r *Relation) PrimaryKey() *PrimaryKey
type TplESIndexMappingField ¶
Click to show internal directories.
Click to hide internal directories.