Documentation ¶
Index ¶
- Constants
- Variables
- func FormatJSON(e Interface) string
- func ParseJSON(out Interface, json string) error
- func SetPriority(value int)
- type Bool
- func (me *Bool) Column() schema.Column
- func (me *Bool) Field() Field
- func (me *Bool) HasInsert() bool
- func (me *Bool) HasUpdate() bool
- func (me *Bool) Name() string
- func (me *Bool) SetColumn(v schema.Column)
- func (me *Bool) SetDefault(v string) error
- func (me *Bool) SetField(v Field)
- func (me *Bool) SetString(v string) error
- func (me *Bool) SetValue(v bool)
- func (me *Bool) String() string
- func (me *Bool) Value() bool
- func (me *Bool) ValuePtr() *bool
- type Excel
- type Field
- type Float32
- func (me *Float32) Column() schema.Column
- func (me *Float32) Field() Field
- func (me *Float32) HasInsert() bool
- func (me *Float32) HasUpdate() bool
- func (me *Float32) Name() string
- func (me *Float32) SetColumn(v schema.Column)
- func (me *Float32) SetDefault(v string) error
- func (me *Float32) SetField(v Field)
- func (me *Float32) SetString(v string) error
- func (me *Float32) SetValue(v float32)
- func (me *Float32) String() string
- func (me *Float32) Value() float32
- func (me *Float32) ValuePtr() *float32
- type Float64
- func (me *Float64) Column() schema.Column
- func (me *Float64) Field() Field
- func (me *Float64) HasInsert() bool
- func (me *Float64) HasUpdate() bool
- func (me *Float64) Name() string
- func (me *Float64) SetColumn(v schema.Column)
- func (me *Float64) SetDefault(v string) error
- func (me *Float64) SetField(v Field)
- func (me *Float64) SetString(v string) error
- func (me *Float64) SetValue(v float64)
- func (me *Float64) String() string
- func (me *Float64) Value() float64
- func (me *Float64) ValuePtr() *float64
- type Int
- func (me *Int) Column() schema.Column
- func (me *Int) Field() Field
- func (me *Int) HasInsert() bool
- func (me *Int) HasUpdate() bool
- func (me *Int) Name() string
- func (me *Int) SetColumn(v schema.Column)
- func (me *Int) SetDefault(v string) error
- func (me *Int) SetField(v Field)
- func (me *Int) SetString(v string) error
- func (me *Int) SetValue(v int)
- func (me *Int) String() string
- func (me *Int) Value() int
- func (me *Int) ValuePtr() *int
- type Int16
- func (me *Int16) Column() schema.Column
- func (me *Int16) Field() Field
- func (me *Int16) HasInsert() bool
- func (me *Int16) HasUpdate() bool
- func (me *Int16) Name() string
- func (me *Int16) SetColumn(v schema.Column)
- func (me *Int16) SetDefault(v string) error
- func (me *Int16) SetField(v Field)
- func (me *Int16) SetString(v string) error
- func (me *Int16) SetValue(v int16)
- func (me *Int16) String() string
- func (me *Int16) Value() int16
- func (me *Int16) ValuePtr() *int16
- type Int32
- func (me *Int32) Column() schema.Column
- func (me *Int32) Field() Field
- func (me *Int32) HasInsert() bool
- func (me *Int32) HasUpdate() bool
- func (me *Int32) Name() string
- func (me *Int32) SetColumn(v schema.Column)
- func (me *Int32) SetDefault(v string) error
- func (me *Int32) SetField(v Field)
- func (me *Int32) SetString(v string) error
- func (me *Int32) SetValue(v int32)
- func (me *Int32) String() string
- func (me *Int32) Value() int32
- func (me *Int32) ValuePtr() *int32
- type Int64
- func (me *Int64) Column() schema.Column
- func (me *Int64) Field() Field
- func (me *Int64) HasInsert() bool
- func (me *Int64) HasUpdate() bool
- func (me *Int64) Name() string
- func (me *Int64) SetColumn(v schema.Column)
- func (me *Int64) SetDefault(v string) error
- func (me *Int64) SetField(v Field)
- func (me *Int64) SetString(v string) error
- func (me *Int64) SetValue(v int64)
- func (me *Int64) String() string
- func (me *Int64) Value() int64
- func (me *Int64) ValuePtr() *int64
- type Int8
- func (me *Int8) Column() schema.Column
- func (me *Int8) Field() Field
- func (me *Int8) HasInsert() bool
- func (me *Int8) HasUpdate() bool
- func (me *Int8) Name() string
- func (me *Int8) SetColumn(v schema.Column)
- func (me *Int8) SetDefault(v string) error
- func (me *Int8) SetField(v Field)
- func (me *Int8) SetString(v string) error
- func (me *Int8) SetValue(v int8)
- func (me *Int8) String() string
- func (me *Int8) Value() int8
- func (me *Int8) ValuePtr() *int8
- type Interface
- type Interfaces
- type Json
- type Pk
- func (me *Pk) Column(field string) (schema.Column, bool)
- func (me *Pk) Get(column string) interface{}
- func (me *Pk) GetPtr(column string) interface{}
- func (me *Pk) GetString(field string) string
- func (me *Pk) Id() string
- func (me *Pk) SetId(v string)
- func (me *Pk) SetString(field, value string) error
- func (me *Pk) Type(column string) (Type, bool)
- type String
- func (me *String) Column() schema.Column
- func (me *String) Field() Field
- func (me *String) HasInsert() bool
- func (me *String) HasUpdate() bool
- func (me *String) Name() string
- func (me *String) SetColumn(v schema.Column)
- func (me *String) SetDefault(v string) error
- func (me *String) SetField(v Field)
- func (me *String) SetString(v string) error
- func (me *String) SetValue(v string)
- func (me *String) String() string
- func (me *String) Value() string
- func (me *String) ValuePtr() *[]byte
- type Sys
- func (me *Sys) Artifical() int
- func (me *Sys) Column(field string) (schema.Column, bool)
- func (me *Sys) Created() int64
- func (me *Sys) Creater() string
- func (me *Sys) Creates() string
- func (me *Sys) Deletion() int
- func (me *Sys) Get(column string) interface{}
- func (me *Sys) GetPtr(column string) interface{}
- func (me *Sys) GetString(field string) string
- func (me *Sys) History() int
- func (me *Sys) Memo() string
- func (me *Sys) Modified() int64
- func (me *Sys) Modifier() string
- func (me *Sys) SetArtifical(v int)
- func (me *Sys) SetCreated(v int64)
- func (me *Sys) SetCreater(v string)
- func (me *Sys) SetCreates(v string)
- func (me *Sys) SetDeletion(v int)
- func (me *Sys) SetHistory(v int)
- func (me *Sys) SetMemo(v string)
- func (me *Sys) SetModified(v int64)
- func (me *Sys) SetModifier(v string)
- func (me *Sys) SetString(field, value string) error
- func (me *Sys) SetVersion(v int)
- func (me *Sys) Type(column string) (Type, bool)
- func (me *Sys) Version() int
- type Time
- func (me *Time) Column() schema.Column
- func (me *Time) Field() Field
- func (me *Time) HasInsert() bool
- func (me *Time) HasUpdate() bool
- func (me *Time) Name() string
- func (me *Time) SetColumn(v schema.Column)
- func (me *Time) SetDefault(layout, value string) error
- func (me *Time) SetField(v Field)
- func (me *Time) SetString(layout, value string) error
- func (me *Time) SetValue(v time.Time)
- func (me *Time) String() string
- func (me *Time) Value() time.Time
- func (me *Time) ValuePtr() *time.Time
- type Tree
- func (me *Tree) Code() string
- func (me *Tree) Column(field string) (schema.Column, bool)
- func (me *Tree) Fullname() string
- func (me *Tree) Genre() string
- func (me *Tree) Get(column string) interface{}
- func (me *Tree) GetPtr(column string) interface{}
- func (me *Tree) GetString(field string) string
- func (me *Tree) Grade() int
- func (me *Tree) Leaf() int
- func (me *Tree) Name() string
- func (me *Tree) Ordinal() string
- func (me *Tree) ParentCodes() string
- func (me *Tree) ParentId() string
- func (me *Tree) ParentIds() string
- func (me *Tree) ParentNames() string
- func (me *Tree) SetCode(v string)
- func (me *Tree) SetFullname(v string)
- func (me *Tree) SetGenre(v string)
- func (me *Tree) SetGrade(v int)
- func (me *Tree) SetLeaf(v int)
- func (me *Tree) SetName(v string)
- func (me *Tree) SetOrdinal(v string)
- func (me *Tree) SetParentCodes(v string)
- func (me *Tree) SetParentId(v string)
- func (me *Tree) SetParentIds(v string)
- func (me *Tree) SetParentNames(v string)
- func (me *Tree) SetString(field, value string) error
- func (me *Tree) Type(column string) (Type, bool)
- type Type
- type Uint
- func (me *Uint) Column() schema.Column
- func (me *Uint) Field() Field
- func (me *Uint) HasInsert() bool
- func (me *Uint) HasUpdate() bool
- func (me *Uint) Name() string
- func (me *Uint) SetColumn(v schema.Column)
- func (me *Uint) SetDefault(v string) error
- func (me *Uint) SetField(v Field)
- func (me *Uint) SetString(v string) error
- func (me *Uint) SetValue(v uint)
- func (me *Uint) String() string
- func (me *Uint) Value() uint
- func (me *Uint) ValuePtr() *uint
- type Uint16
- func (me *Uint16) Column() schema.Column
- func (me *Uint16) Field() Field
- func (me *Uint16) HasInsert() bool
- func (me *Uint16) HasUpdate() bool
- func (me *Uint16) Name() string
- func (me *Uint16) SetColumn(v schema.Column)
- func (me *Uint16) SetDefault(v string) error
- func (me *Uint16) SetField(v Field)
- func (me *Uint16) SetString(v string) error
- func (me *Uint16) SetValue(v uint16)
- func (me *Uint16) String() string
- func (me *Uint16) Value() uint16
- func (me *Uint16) ValuePtr() *uint16
- type Uint32
- func (me *Uint32) Column() schema.Column
- func (me *Uint32) Field() Field
- func (me *Uint32) HasInsert() bool
- func (me *Uint32) HasUpdate() bool
- func (me *Uint32) Name() string
- func (me *Uint32) SetColumn(v schema.Column)
- func (me *Uint32) SetDefault(v string) error
- func (me *Uint32) SetField(v Field)
- func (me *Uint32) SetString(v string) error
- func (me *Uint32) SetValue(v uint32)
- func (me *Uint32) String() string
- func (me *Uint32) Value() uint32
- func (me *Uint32) ValuePtr() *uint32
- type Uint64
- func (me *Uint64) Column() schema.Column
- func (me *Uint64) Field() Field
- func (me *Uint64) HasInsert() bool
- func (me *Uint64) HasUpdate() bool
- func (me *Uint64) Name() string
- func (me *Uint64) SetColumn(v schema.Column)
- func (me *Uint64) SetDefault(v string) error
- func (me *Uint64) SetField(v Field)
- func (me *Uint64) SetString(v string) error
- func (me *Uint64) SetValue(v uint64)
- func (me *Uint64) String() string
- func (me *Uint64) Value() uint64
- func (me *Uint64) ValuePtr() *uint64
- type Uint8
- func (me *Uint8) Column() schema.Column
- func (me *Uint8) Field() Field
- func (me *Uint8) HasInsert() bool
- func (me *Uint8) HasUpdate() bool
- func (me *Uint8) Name() string
- func (me *Uint8) SetColumn(v schema.Column)
- func (me *Uint8) SetDefault(v string) error
- func (me *Uint8) SetField(v Field)
- func (me *Uint8) SetString(v string) error
- func (me *Uint8) SetValue(v uint8)
- func (me *Uint8) String() string
- func (me *Uint8) Value() uint8
- func (me *Uint8) ValuePtr() *uint8
- type Xml
Constants ¶
const ( // DeletionEnable Deletion = 0 DeletionEnable = 0 // logical delete : no // DeletionDisable Deletion = 1 DeletionDisable = 1 // logical delete : yes )
Variables ¶
var SysColumns = [...]string{
"id",
"memo",
"creates",
"creater",
"created",
"modifier",
"modified",
"version",
"deletion",
"artifical",
"history",
}
SysColumns default column for Sys structure.
var SysFields = [...]string{
"id",
"memo",
"creates",
"creater",
"created",
"modifier",
"modified",
"version",
"deletion",
"artifical",
"history",
}
SysFields default field for Sys structure.
var TreeColumns = [...]string{
"id",
"code",
"name",
"fullname",
"genre",
"leaf",
"grade",
"ordinal",
"parent_id",
"parent_ids",
"parent_codes",
"parent_names",
"memo",
"creates",
"creater",
"created",
"modifier",
"modified",
"version",
"deletion",
"artifical",
"history",
}
TreeColumns default column for Tree structure.
var TreeFields = [...]string{
"id",
"code",
"name",
"fullname",
"genre",
"leaf",
"grade",
"ordinal",
"parentId",
"parentIds",
"parentCodes",
"parentNames",
"memo",
"creates",
"creater",
"created",
"modifier",
"modified",
"version",
"deletion",
"artifical",
"history",
}
TreeFields default field for Tree structure.
Functions ¶
Types ¶
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
Bool bool type.
func (*Bool) SetDefault ¶
SetDefault sets the default value.
type Excel ¶
type Excel interface { Value() string // Name of the way to get the value of a field SetValue(v string) // SetValue Title() string // The title of the entity field displayed in the excel SetTitle(v string) // SetTitle Format() string // The format of the entity field displayed in the excel SetFormat(v string) // SetFormat Genre() int // Field type(0:export or import,1:export only,2:import only) SetGenre(v int) // SetGenre Align() int // Alignment of columns(0:automatic,1:left,2:middle,3:right) SetAlign(v int) // SetAlign Sort() int // Display order of columns in the excel(0:asc,1:desc) SetSort(v int) // SetSort Width() int // Display width of columns in the excel SetWidth(v int) // SetWidth }
Excel import and export information for the field of the entity struct.
func NewExcelBy ¶
NewExcelBy returns the Excel from value, title, format, genre, align, sort, width.
type Field ¶
type Field interface { Insertable() bool SetInsertable(v bool) Updateable() bool SetUpdateable(v bool) Modified() bool SetModified(v bool) Excel() Excel SetExcel(v Excel) Json() Json SetJson(v Json) Xml() Xml SetXml(v Xml) }
Field entity.Field.
type Float32 ¶
type Float32 struct {
// contains filtered or unexported fields
}
Float32 float32 type.
func (*Float32) SetDefault ¶
SetDefault sets the default value.
type Float64 ¶
type Float64 struct {
// contains filtered or unexported fields
}
Float64 float64 type.
func (*Float64) SetDefault ¶
SetDefault sets the default value.
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
Int int type.
func (*Int) SetDefault ¶
SetDefault sets the default value.
type Int16 ¶
type Int16 struct {
// contains filtered or unexported fields
}
Int16 int16 type.
func (*Int16) SetDefault ¶
SetDefault sets the default value.
type Int32 ¶
type Int32 struct {
// contains filtered or unexported fields
}
Int32 int32 type.
func (*Int32) SetDefault ¶
SetDefault sets the default value.
type Int64 ¶
type Int64 struct {
// contains filtered or unexported fields
}
Int64 int64 type.
func (*Int64) SetDefault ¶
SetDefault sets the default value.
type Int8 ¶
type Int8 struct {
// contains filtered or unexported fields
}
Int8 int8 type.
func (*Int8) SetDefault ¶
SetDefault sets the default value.
type Interface ¶
type Interface interface { New() Interface Get(column string) interface{} GetPtr(column string) interface{} GetString(field string) string SetString(field, value string) error Type(column string) (Type, bool) Table() schema.Table Column(field string) (schema.Column, bool) Columns() []schema.Column Names() []string Validate() error JSON() string ExcelColumns() []string }
Interface entity.Interface.
type Interfaces ¶
type Interfaces interface { Make(v int) New() Interface Append(v Interface) Len() int Cap() int Index(i int) Interface Slice() interface{} JSON() string }
Interfaces entity.Interfaces.
type Json ¶
type Json interface { Tag() string // Get Tag SetTag(v string) // Set Tag Name() string // Field appears in JSON as key name Omitempty() bool // The field is omitted from the object if its value is empty Ignored() bool // Field is ignored by this package }
Json information for the field of the entity struct.
type Pk ¶
type Pk struct {
// contains filtered or unexported fields
}
Pk database primary key.
type String ¶
type String struct {
// contains filtered or unexported fields
}
String string type.
func (*String) SetDefault ¶
SetDefault sets the default value.
type Sys ¶
type Sys struct { Pk // contains filtered or unexported fields }
Sys sys structure used for inheritance.
func (*Sys) SetArtifical ¶
SetArtifical sets the value of the artifical attribute in the entity.Sys.
func (*Sys) SetCreated ¶
SetCreated sets the value of the created attribute in the entity.Sys.
func (*Sys) SetCreater ¶
SetCreater sets the value of the creater attribute in the entity.Sys.
func (*Sys) SetCreates ¶
SetCreates sets the value of the creates attribute in the entity.Sys.
func (*Sys) SetDeletion ¶
SetDeletion sets the value of the deletion attribute in the entity.Sys.
func (*Sys) SetHistory ¶
SetHistory sets the value of the history attribute in the entity.Sys.
func (*Sys) SetModified ¶
SetModified sets the value of the modified attribute in the entity.Sys.
func (*Sys) SetModifier ¶
SetModifier sets the value of the nodifier attribute in the entity.Sys.
func (*Sys) SetVersion ¶
SetVersion sets the value of the version attribute in the entity.Sys.
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
Time time type.
func (*Time) SetDefault ¶
SetDefault sets the default value.
type Tree ¶
type Tree struct { Sys // contains filtered or unexported fields }
Tree tree structure used for inheritance.
func (*Tree) ParentCodes ¶
ParentCodes gets the value of the parentCodes attribute in the entity.Tree.
func (*Tree) ParentNames ¶
ParentNames gets the value of the parentNames attribute in the entity.Tree.
func (*Tree) SetFullname ¶
SetFullname sets the value of the fullname attribute in the entity.Tree.
func (*Tree) SetOrdinal ¶
SetOrdinal sets the value of the ordinal attribute in the entity.Tree.
func (*Tree) SetParentCodes ¶
SetParentCodes sets the value of the parentCodes attribute in the entity.Tree.
func (*Tree) SetParentId ¶
SetParentId sets the value of the parentId attribute in the entity.Tree.
func (*Tree) SetParentIds ¶
SetParentIds sets the value of the parentIds attribute in the entity.Tree.
func (*Tree) SetParentNames ¶
SetParentNames sets the value of the parentNames attribute in the entity.Tree.
type Type ¶
type Type interface { Name() string Column() schema.Column SetColumn(v schema.Column) Field() Field SetField(v Field) String() string SetString(v string) error SetDefault(v string) error HasUpdate() bool HasInsert() bool }
Type entity.Type.
type Uint ¶
type Uint struct {
// contains filtered or unexported fields
}
Uint uint type.
func (*Uint) SetDefault ¶
SetDefault sets the default value.
type Uint16 ¶
type Uint16 struct {
// contains filtered or unexported fields
}
Uint16 uint16 type.
func (*Uint16) SetDefault ¶
SetDefault sets the default value.
type Uint32 ¶
type Uint32 struct {
// contains filtered or unexported fields
}
Uint32 uint32 type.
func (*Uint32) SetDefault ¶
SetDefault sets the default value.
type Uint64 ¶
type Uint64 struct {
// contains filtered or unexported fields
}
Uint64 uint64 type.
func (*Uint64) SetDefault ¶
SetDefault sets the default value.
type Uint8 ¶
type Uint8 struct {
// contains filtered or unexported fields
}
Uint8 uint8 type.
func (*Uint8) SetDefault ¶
SetDefault sets the default value.
type Xml ¶
type Xml interface { Tag() string // Get Tag SetTag(v string) // Set Tag Name() string // Field appears in XML as key name Omitempty() bool // The field is omitted from the object if its value is empty Ignored() bool // Field is ignored by this package }
Xml information for the field of the entity struct.
Source Files ¶
- api_entity.go
- api_field.go
- api_field_excel.go
- api_field_json.go
- api_field_xml.go
- api_type.go
- core_base_pk.go
- core_base_sys.go
- core_base_tree.go
- core_const.go
- core_field.go
- core_field_excel.go
- core_field_json.go
- core_field_xml.go
- core_log.go
- core_type_base.go
- core_type_bool.go
- core_type_float32.go
- core_type_float64.go
- core_type_int.go
- core_type_int16.go
- core_type_int32.go
- core_type_int64.go
- core_type_int8.go
- core_type_string.go
- core_type_time.go
- core_type_uint.go
- core_type_uint16.go
- core_type_uint32.go
- core_type_uint64.go
- core_type_uint8.go
- core_util.go