Documentation ¶
Overview ¶
共享事件结构定义
功能性方法文件
Index ¶
- Constants
- Variables
- func AskSwapSort(s string) string
- func Exec(e *Event)
- func HttpPostByte(url string, param []byte, head map[string]string) ([]byte, error)
- func LoadByQuery(e *Event)
- func Quick(arr []int)
- func ValToFloat(v interface{}) float64
- func ValToInt(v interface{}) (int, error)
- type DbConfig
- type Engine
- type Event
- func (e *Event) BuildDataMode(mode interface{}, data []map[string]interface{}) (list []interface{})
- func (e *Event) ExecByPsql(sql string, val []interface{}) (sql.Result, error)
- func (e *Event) Push(data interface{})
- func (e *Event) QueryByPsql() (objs interface{}, total int, err error)
- func (e *Event) Rsp() interface{}
- func (e *Event) SetHandel(s func(event *Event))
- func (e *Event) SetSm(sm *SqlModify)
- type EventQueue
- type Handle
- type LogLevel
- type Logger
- type MySql
- type PSql
- type SqlDiff
- type SqlModify
- func (sm *SqlModify) And(c string, diff SqlDiff, val ...interface{}) *SqlModify
- func (sm *SqlModify) MysqlLimit() string
- func (sm *SqlModify) MysqlQuery() (list []map[string]interface{}, total int, err error)
- func (sm *SqlModify) MysqlQueryBuild() (string, []interface{})
- func (sm *SqlModify) Or(c string, diff SqlDiff, val ...interface{}) *SqlModify
- func (sm *SqlModify) PgQueryList(db *sql.DB, sql string, val ...interface{}) (list []map[string]interface{}, total int, err error)
- func (sm *SqlModify) PsqlLimit() string
- func (sm *SqlModify) PsqlQueryBuild() (string, []interface{})
- func (sm *SqlModify) SetPage(p int) *SqlModify
- func (sm *SqlModify) SetSize(s int) *SqlModify
- func (sm *SqlModify) SetSwapObj(f SwapObj) *SqlModify
- func (sm *SqlModify) SetTable(table string) *SqlModify
- type SwapObj
Constants ¶
View Source
const (
EnPage = "SQL_CALC_FOUND_ROWS" //开启分页
)
Variables ¶
Functions ¶
func HttpPostByte ¶
func LoadByQuery ¶ added in v1.9.7
func LoadByQuery(e *Event)
Types ¶
type DbConfig ¶
type DbConfig struct { Host string Port int User string Pwd string DbName string MaxOpenConn int MaxIdleConn int ConnMaxLifetime int }
数据库连接配置
type Engine ¶ added in v1.8.7
func (*Engine) OutSuccess ¶ added in v1.8.7
func (e *Engine) OutSuccess()
type Event ¶ added in v1.8.7
type Event struct { IsWrite bool Eg *Engine //执行的sql ExecSql string //查询时主键值,根据此值优先取缓存,执行时是参数填充 Keys []interface{} // contains filtered or unexported fields }
数据事件对象
func (*Event) BuildDataMode ¶ added in v1.8.7
func (*Event) ExecByPsql ¶ added in v1.8.7
func (*Event) QueryByPsql ¶ added in v1.8.7
type EventQueue ¶ added in v1.8.7
type EventQueue struct {
// contains filtered or unexported fields
}
func NewEventQueue ¶ added in v1.8.7
func NewEventQueue(l int) *EventQueue
type SqlModify ¶
type SqlModify struct { //数据库查询出来的数据转对象 F SwapObj // contains filtered or unexported fields }
sql编辑对象
func (*SqlModify) MysqlLimit ¶
func (*SqlModify) MysqlQuery ¶
mysql查询
func (*SqlModify) MysqlQueryBuild ¶ added in v1.6.1
func (*SqlModify) PgQueryList ¶ added in v1.5.2
func (*SqlModify) PsqlQueryBuild ¶ added in v1.6.1
func (*SqlModify) SetSwapObj ¶ added in v1.6.8
Click to show internal directories.
Click to hide internal directories.