Documentation ¶
Index ¶
- Constants
- func Delete(a interface{}) interface{}
- func Equal(v1, v2 Value) bool
- func GetTableName(m ModelInterface) string
- func Less(v1, v2 Value) bool
- func LessOrEqual(v1, v2 Value) bool
- func ModelName(m ModelInterface) (ret string)
- func More(v1, v2 Value) bool
- func MoreOrEqual(v1, v2 Value) bool
- func Refresh(a interface{}) interface{}
- func Save(a interface{}) interface{}
- type Association
- type AssociationKind
- type Condition
- func (c *Condition) Eq(v interface{}) *Condition
- func (c *Condition) Gt(v interface{}) *Condition
- func (c *Condition) GtEq(v interface{}) *Condition
- func (c *Condition) IsNotNull() *Condition
- func (c *Condition) IsNull() *Condition
- func (c *Condition) Lt(v interface{}) *Condition
- func (c *Condition) LtEq(v interface{}) *Condition
- func (c *Condition) NEq(v interface{}) *Condition
- func (c *Condition) Or(c2 *Condition) *Condition
- func (c *Condition) String() string
- func (c *Condition) Value(v interface{}) *Condition
- type Connection
- type ConnectionStore
- type Model
- func (m *Model) All() []interface{}
- func (m *Model) Attributes() map[string]reflect.Type
- func (m *Model) AttributesNames() (ret []string)
- func (m *Model) BelongsToKey(am *Model, name, key string)
- func (m *Model) Count(fields ...[]string) int
- func (m *Model) Delete(a interface{}) interface{}
- func (m *Model) First() interface{}
- func (m *Model) GetAssociated(name string, in interface{}) interface{}
- func (m *Model) HasManyKey(am *Model, name, key string)
- func (m *Model) HasONEKey(am *Model, name, key string)
- func (m *Model) Last() interface{}
- func (m *Model) Order(x, y string) *ModelRelation
- func (m *Model) Refresh(a interface{}) interface{}
- func (m *Model) Save(a interface{}) interface{}
- func (m *Model) TableName() string
- func (m *Model) Where(x *Condition) *ModelRelation
- type ModelInterface
- type ModelRelation
- func (r *ModelRelation) All() []interface{}
- func (r *ModelRelation) Count(fields ...[]string) int
- func (r *ModelRelation) First() interface{}
- func (r *ModelRelation) Last() interface{}
- func (r *ModelRelation) Order(x, y string) *ModelRelation
- func (r *ModelRelation) Where(x *Condition) *ModelRelation
- type ModelStore
- type MysqlConnector
- type NullModel
- type OperandKind
- type Relation
- func (r *Relation) Count(fields []string) *Relation
- func (r *Relation) Delete() *Relation
- func (r *Relation) First() *Relation
- func (r *Relation) Insert(mp map[string]Value) *Relation
- func (r *Relation) Limit(offset, count int) *Relation
- func (r *Relation) Order(field, direction string) *Relation
- func (r *Relation) String() string
- func (r *Relation) Table(t string) *Relation
- func (r *Relation) Update(mp map[string]Value, identifier string, id int) *Relation
- func (r *Relation) Where(s *Condition) *Relation
- type RequestKind
- type SysInt
- type SysString
- type Value
- type ValueVector
- type WriteValue
- type XMLConnector
- func (e *XMLConnector) Close()
- func (e *XMLConnector) Commit()
- func (e *XMLConnector) CreateTable(table string) *XMLTable
- func (e *XMLConnector) CreateTableWithoutId(table string) *XMLTable
- func (e *XMLConnector) Open(connectionString string) bool
- func (e *XMLConnector) Query(r *Relation) *vector.Vector
- func (e *XMLConnector) Table(table string) *XMLTable
- type XMLTable
Constants ¶
View Source
const ( EOOKind = iota NumberKind StringKind BooleanKind NullKind IntKind LongKind )
Variables ¶
This section is empty.
Functions ¶
func GetTableName ¶
func GetTableName(m ModelInterface) string
func LessOrEqual ¶
func ModelName ¶
func ModelName(m ModelInterface) (ret string)
func MoreOrEqual ¶
Types ¶
type Association ¶
type Association struct {
// contains filtered or unexported fields
}
type AssociationKind ¶
type AssociationKind int
const ( BELONGS_TO AssociationKind = iota HAS_MANY HAS_ONE HAS_AND_BELONGS_TO_MANY )
type Connection ¶
type Connection interface { Open(connectionString string) bool Query(r *Relation) *vector.Vector Close() }
func OpenMysql ¶
func OpenMysql(conStr string) Connection
func OpenXML ¶
func OpenXML(conStr string) Connection
type ConnectionStore ¶
type ConnectionStore []*Connection
func GetConnectionStore ¶
func GetConnectionStore() *ConnectionStore
func (*ConnectionStore) Last ¶
func (cs *ConnectionStore) Last() *Connection
func (*ConnectionStore) RegisterConnection ¶
func (cs *ConnectionStore) RegisterConnection(c *Connection) *Connection
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func M ¶
func M(m ModelInterface) *Model
func (*Model) AttributesNames ¶
func (*Model) BelongsToKey ¶
func (*Model) GetAssociated ¶
func (*Model) HasManyKey ¶
func (*Model) Order ¶
func (m *Model) Order(x, y string) *ModelRelation
func (*Model) Where ¶
func (m *Model) Where(x *Condition) *ModelRelation
type ModelInterface ¶
* Types *
type ModelRelation ¶
type ModelRelation struct {
// contains filtered or unexported fields
}
func (*ModelRelation) All ¶
func (r *ModelRelation) All() []interface{}
func (*ModelRelation) Count ¶
func (r *ModelRelation) Count(fields ...[]string) int
func (*ModelRelation) First ¶
func (r *ModelRelation) First() interface{}
func (*ModelRelation) Last ¶
func (r *ModelRelation) Last() interface{}
func (*ModelRelation) Order ¶
func (r *ModelRelation) Order(x, y string) *ModelRelation
func (*ModelRelation) Where ¶
func (r *ModelRelation) Where(x *Condition) *ModelRelation
type ModelStore ¶
func GetModelStore ¶
func GetModelStore() *ModelStore
func (*ModelStore) RegisterModel ¶
func (st *ModelStore) RegisterModel(m ModelInterface) *Model
func (*ModelStore) RegisterModelWithConnection ¶
func (st *ModelStore) RegisterModelWithConnection(m ModelInterface, conn *Connection) *Model
type MysqlConnector ¶
type MysqlConnector struct {
// contains filtered or unexported fields
}
func (*MysqlConnector) Close ¶
func (e *MysqlConnector) Close()
func (*MysqlConnector) Open ¶
func (e *MysqlConnector) Open(connectionString string) bool
type OperandKind ¶
type OperandKind int
const ( NULL OperandKind = iota EQUAL NOTEQUAL ISNOTNULL ISNULL GREATER LOWER GREATEROREQUAL LOWEROREQUAL OR )
type Relation ¶
type Relation struct {
// contains filtered or unexported fields
}
func NewRelation ¶
func NewRelation(t interface{}) (r *Relation)
type RequestKind ¶
type RequestKind int
const ( SELECT RequestKind = iota UPDATE INSERT COUNT DELETE )
type ValueVector ¶
func (*ValueVector) Less ¶
func (v *ValueVector) Less(i, j int) bool
type WriteValue ¶
type XMLConnector ¶
type XMLConnector struct {
// contains filtered or unexported fields
}
func (*XMLConnector) Close ¶
func (e *XMLConnector) Close()
func (*XMLConnector) Commit ¶
func (e *XMLConnector) Commit()
func (*XMLConnector) CreateTable ¶
func (e *XMLConnector) CreateTable(table string) *XMLTable
func (*XMLConnector) CreateTableWithoutId ¶
func (e *XMLConnector) CreateTableWithoutId(table string) *XMLTable
func (*XMLConnector) Open ¶
func (e *XMLConnector) Open(connectionString string) bool
func (*XMLConnector) Table ¶
func (e *XMLConnector) Table(table string) *XMLTable
type XMLTable ¶
type XMLTable struct {
// contains filtered or unexported fields
}
func (*XMLTable) AddAttribute ¶
func (*XMLTable) Attributes ¶
func (*XMLTable) Data ¶
func (e *XMLTable) Data() *ValueVector
Source Files ¶
Click to show internal directories.
Click to hide internal directories.