g2db

package
v2.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SYSKey                = "P6UEgd7ln9mpMz5hGWYqT21cSHOtkJQZ"
	GinContextJWTKey      = "JWT"
	GinContextJWTTokenKey = "JWT_RAW"
)

constants defined

Variables

This section is empty.

Functions

This section is empty.

Types

type CompoundIndex

type CompoundIndex struct {
	//索引字段
	Columns map[string]interface{}
	//是否是唯一索引
	Unique bool
	// contains filtered or unexported fields
}

CompoundIndex 复合索引

func (*CompoundIndex) SetSn

func (c *CompoundIndex) SetSn(sn *xorm.Session)

SetSn ...

type ErrorMysqlNotFound

type ErrorMysqlNotFound string

ErrorMysqlNotFound ...

func (ErrorMysqlNotFound) Error

func (e ErrorMysqlNotFound) Error() string

type ItfCompoundIndex

type ItfCompoundIndex interface {
	CompoundIndexes() []*CompoundIndex
}

ItfCompoundIndex 复合索引接口

type ItfInitData

type ItfInitData interface{ InitData() []interface{} }

ItfInitData ...

type MapString

type MapString map[string]string

MapString ...

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

func (*MyBase) ClearColumns

func (m *MyBase) ClearColumns()

ClearColumns ...

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:""`
	// contains filtered or unexported fields
}

Mysql ...

func (*Mysql) AfterShutdown

func (m *Mysql) AfterShutdown()

AfterShutdown ...

func (*Mysql) CacheGet

func (m *Mysql) CacheGet(bean interface{}, condition ...interface{}) (err error)

CacheGet ...

func (*Mysql) Constructor

func (m *Mysql) Constructor()

Constructor New ...

func (*Mysql) DelCache

func (m *Mysql) DelCache(bean interface{}, condition ...interface{}) (err error)

DelCache ...

func (*Mysql) Delete

func (m *Mysql) Delete(bean interface{}) (err error)

Delete ...

func (*Mysql) Dial

func (m *Mysql) Dial()

Dial MySQL连接拨号

func (*Mysql) Engine

func (m *Mysql) Engine() *xorm.Engine

Engine ...

func (*Mysql) GetOut

func (m *Mysql) GetOut() io.Writer

GetOut ...

func (*Mysql) Insert

func (m *Mysql) Insert(bean interface{}) (err error)

Insert ...

func (*Mysql) Migrate

func (m *Mysql) Migrate()

Migrate ...数据库初始化

func (*Mysql) Sync

func (m *Mysql) Sync() (err error)

Sync ...初始化数据表,结构,数据等

func (*Mysql) TXCallback

func (m *Mysql) TXCallback(fn func(sn *xorm.Session) error) (err error)

TXCallback ...

func (*Mysql) TableRegister

func (m *Mysql) TableRegister(tables ...interface{})

TableRegister ...注册表,用于同步数据表 ... 等

func (*Mysql) Update

func (m *Mysql) Update(bean interface{}, params ...interface{}) (err error)

Update ...

type RedisSubHandlerFunc

type RedisSubHandlerFunc func(payload []byte)

RedisSubHandlerFunc ...

type Slice

type Slice []interface{}

Slice ...

func (Slice) Asc

func (s Slice) Asc(call interface{}) Slice

Asc ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL