Documentation ¶
Index ¶
- Constants
- Variables
- func HasError(e error) (bool, error)
- type CompoundIndex
- type ErrorMysqlNotFound
- type ItfCompoundIndex
- type ItfGinContext
- type ItfInitData
- type ItfMysqlAfterQueryRow
- type ItfSessionAfterDelete
- type ItfSessionAfterInsert
- type ItfSessionAfterUpdate
- type ItfSessionBeforeDelete
- type ItfSessionBeforeInsert
- type ItfSessionBeforeUpdate
- type MapString
- type MyBase
- type MyBase1
- type Mysql
- func (m *Mysql) AfterShutdown()
- func (m *Mysql) CacheGet(bean interface{}, condition ...interface{}) (err error)
- func (m *Mysql) CacheGetWrapSession(bean interface{}, arg interface{}, condition ...interface{}) (err error)
- func (m *Mysql) Constructor()
- func (m *Mysql) DelCache(bean interface{}, condition ...interface{}) (err error)
- func (m *Mysql) Delete(bean interface{}) (err error)
- func (m *Mysql) Dial()
- func (m *Mysql) Engine() *xorm.Engine
- func (m *Mysql) GetBeanByTableName(tableStr string) (bean interface{}, err error)
- func (m *Mysql) GetOut() io.Writer
- func (m *Mysql) Insert(bean interface{}) error
- func (m *Mysql) Migrate()
- func (m *Mysql) QueryRows(val interface{}, params *MysqlQueryRowsParams) (rows *MysqlRows, err error)
- func (m *Mysql) QueryTableRows(tableStr string, params *MysqlQueryRowsParams) (rows *MysqlRows, err error)
- func (m *Mysql) Sync() (err error)
- func (m *Mysql) TXCallback(fn func(sn *xorm.Session) (err error)) (err error)
- func (m *Mysql) TableRegister(tables ...interface{})
- func (m *Mysql) Tables() []interface{}
- func (m *Mysql) Update(bean interface{}, params ...interface{}) (newBean interface{}, err error)
- type MysqlQueryRowsParams
- type MysqlRows
- type Query
- type RedisSubHandlerFunc
- type Slice
- type Token
- func (t *Token) AfterLogin(ctx context.Context, id int64) (td *TokenData, err error)
- func (t *Token) Constructor()
- func (t *Token) Logout(ctx context.Context, id int64) (err error)
- func (t *Token) NewCopy(key string) *Token
- func (t *Token) Option() *TokenOption
- func (t *Token) Verify(ctx ItfGinContext, fns ...func() error) (err error)
- type TokenData
- type TokenOption
Constants ¶
const ( SYSKey = "P6UEgd7ln9mpMz5hGWYqT21cSHOtkJQZ" GinContextJWTTokenKey = "JWT_RAW" GinContextJWTUIDKey = "JWT_UID" )
constants
Variables ¶
var Locker = new(lock)
Locker ...
Functions ¶
Types ¶
type CompoundIndex ¶
type CompoundIndex struct { //索引字段 Columns map[string]interface{} //是否是唯一索引 Unique bool // contains filtered or unexported fields }
CompoundIndex 复合索引
type ErrorMysqlNotFound ¶
type ErrorMysqlNotFound string
ErrorMysqlNotFound ...
func (ErrorMysqlNotFound) Error ¶
func (e ErrorMysqlNotFound) Error() string
type ItfCompoundIndex ¶
type ItfCompoundIndex interface {
CompoundIndexes() []*CompoundIndex
}
ItfCompoundIndex 复合索引接口
type ItfGinContext ¶ added in v2.0.4
type ItfGinContext interface { context.Context Set(key string, value interface{}) GetHeader(key string) string Query(key string) string }
ItfGinContext ...
type ItfMysqlAfterQueryRow ¶ added in v2.0.4
type ItfMysqlAfterQueryRow interface {
MysqlAfterQueryRow()
}
ItfMysqlAfterQueryRow ...
type ItfSessionAfterDelete ¶ added in v2.1.3
ItfSessionAfterDelete ...
type ItfSessionAfterInsert ¶ added in v2.1.3
ItfSessionAfterInsert ...
type ItfSessionAfterUpdate ¶ added in v2.1.3
ItfSessionAfterUpdate ...
type ItfSessionBeforeDelete ¶ added in v2.1.3
ItfSessionBeforeDelete ...
type ItfSessionBeforeInsert ¶ added in v2.1.3
ItfSessionBeforeInsert ...
type ItfSessionBeforeUpdate ¶ added in v2.1.3
ItfSessionBeforeUpdate ...
type MyBase ¶
type MyBase struct { MyBase1 `xorm:"extends"` Updated *g2util.JSONTime `json:"updated,omitempty" xorm:"notnull default CURRENT_TIMESTAMP updated comment('更新时间')"` Version int64 `json:"version,omitempty" xorm:"notnull default 1 version comment('乐观锁')"` }
MyBase xorm MySQL model base
type MyBase1 ¶
type MyBase1 struct { ID int64 `json:"id,omitempty" xorm:"pk autoincr"` Created *g2util.JSONTime `json:"created,omitempty" xorm:"notnull default CURRENT_TIMESTAMP created index comment('创建时间')"` }
MyBase1 id and created
type Mysql ¶
type Mysql struct { Config *g2util.Config `inject:""` Grace *g2util.Graceful `inject:""` AbFile *g2util.AbFile `inject:""` Redis *redisObj `inject:""` Cache *cacheMem `inject:""` CacheBind *cacheBind `inject:""` // contains filtered or unexported fields }
Mysql ...
func (*Mysql) CacheGetWrapSession ¶ added in v2.2.1
func (m *Mysql) CacheGetWrapSession(bean interface{}, arg interface{}, condition ...interface{}) (err error)
CacheGetWrapSession ...
func (*Mysql) GetBeanByTableName ¶ added in v2.1.2
GetBeanByTableName ...
func (*Mysql) QueryRows ¶ added in v2.0.4
func (m *Mysql) QueryRows(val interface{}, params *MysqlQueryRowsParams) (rows *MysqlRows, err error)
QueryRows ...分页查询,可以指定表名
func (*Mysql) QueryTableRows ¶ added in v2.0.5
func (m *Mysql) QueryTableRows(tableStr string, params *MysqlQueryRowsParams) (rows *MysqlRows, err error)
QueryTableRows ...查询经过注册的表
func (*Mysql) TXCallback ¶
TXCallback ...
func (*Mysql) TableRegister ¶
func (m *Mysql) TableRegister(tables ...interface{})
TableRegister ...注册表,用于同步数据表 ... 等
type MysqlQueryRowsParams ¶ added in v2.0.4
type MysqlQueryRowsParams struct { Page int `json:"page,omitempty"` PageCount int `json:"page_count,omitempty"` Conditions []string `json:"conditions,omitempty"` OrderBy string `json:"order_by,omitempty"` Asc bool `json:"asc,omitempty"` TimeColumn string `json:"time_column"` TimeBetween string `json:"time_between"` }
MysqlQueryRowsParams ...
type MysqlRows ¶ added in v2.0.4
type MysqlRows struct { Pages int `json:"pages,omitempty"` Data interface{} `json:"data,omitempty"` Count int64 `json:"count,omitempty"` }
MysqlRows ...
type Query ¶ added in v2.1.0
type Query struct {
// contains filtered or unexported fields
}
Query ... new(Query).SetDb(*xorm.Engine).QueryRows(val, params) new(Query).SetDb(*xorm.Engine).SetTable(string).QueryRows(val, params)
type Token ¶ added in v2.0.4
type Token struct { Config *g2util.Config `inject:""` Redis *redisObj `inject:""` Cache *cacheMem `inject:""` // contains filtered or unexported fields }
Token ...
func (*Token) AfterLogin ¶ added in v2.0.4
AfterLogin ...