Common

package
v0.0.0-...-44e550c Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbPool *sync.Pool
View Source
var GlobalDb *sql.DB

Functions

This section is empty.

Types

type Message

type Message struct {
	Code    int64
	Message string
	Data    interface{}
}

func (Message) Error

func (Message Message) Error(message string, data interface{}, w http.ResponseWriter)

func (Message) Success

func (Message Message) Success(message string, data interface{}, w http.ResponseWriter)

type MySql

type MySql struct {
	// contains filtered or unexported fields
}

func (*MySql) Close

func (MySql *MySql) Close() error

func (MySql) Delete

func (MySql MySql) Delete(tableName string) int64

* 删除方法

func (MySql) ExecSql

func (MySql MySql) ExecSql(queryStr string) []map[string]string

func (MySql) GetConn

func (MySql MySql) GetConn() *MySql

func (MySql) Insert

func (MySql MySql) Insert(tableName string, data map[string]string) int64

* 插入方法

func (*MySql) Limit

func (MySql *MySql) Limit(number int) *MySql

func (*MySql) OrderByString

func (MySql *MySql) OrderByString(orderString ...string) *MySql

func (MySql) Pagination

func (MySql MySql) Pagination(Page int, Limit int) map[string]interface{}

* 分页查询

func (MySql) QueryAll

func (MySql MySql) QueryAll() []map[string]string

func (MySql) QueryRow

func (MySql MySql) QueryRow() map[string]string

* 查询单行

func (*MySql) Select

func (MySql *MySql) Select(tableName string, field []string) *MySql

* 查询方法

func (MySql) Update

func (MySql MySql) Update(tableName string, str map[string]string) int64

* 更新方法

func (*MySql) Where

func (MySql *MySql) Where(cond map[string]string) *MySql

* where子句

type MysqlCfg

type MysqlCfg struct {
	Source, Driver string
}

Jump to

Keyboard shortcuts

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