mysql

package
v0.0.0-...-1454416 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotVaildFidld = errors.New("无效的字段")

Functions

This section is empty.

Types

type MysqlDb

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

func NewMysql

func NewMysql(cxt context.Context, url string) (*MysqlDb, error)

func (*MysqlDb) BatchInsterCreditInfo

func (m *MysqlDb) BatchInsterCreditInfo(cxt context.Context, tx *sqlx.Tx, c []model.CreditInfo) error

func (*MysqlDb) Begin

func (m *MysqlDb) Begin(ctx context.Context, opts *sql.TxOptions) (*db.Tx, error)

func (*MysqlDb) GetAvailableUserSum

func (m *MysqlDb) GetAvailableUserSum(cxt context.Context) (int, error)

func (*MysqlDb) GetCreditInfo

func (m *MysqlDb) GetCreditInfo(cxt context.Context, uid int) (*model.CreditInfo, error)

func (*MysqlDb) GetGroupCount

func (m *MysqlDb) GetGroupCount(cxt context.Context, groupname string) (int, error)

func (*MysqlDb) GetGroupname

func (m *MysqlDb) GetGroupname(cxt context.Context) ([]string, error)

func (*MysqlDb) GetNilSum

func (m *MysqlDb) GetNilSum(cxt context.Context, field string) (int, error)

func (*MysqlDb) GetRank

func (m *MysqlDb) GetRank(cxt context.Context, uid int, field string) (int, error)

func (*MysqlDb) GetRanks

func (m *MysqlDb) GetRanks(cxt context.Context, field string, limit, offset int, desc bool) ([]model.CreditInfo, error)

func (*MysqlDb) GetSum

func (m *MysqlDb) GetSum(cxt context.Context) (int, error)

func (*MysqlDb) InsterConfig

func (m *MysqlDb) InsterConfig(cxt context.Context, tx *sqlx.Tx, c *model.Confing) error

func (*MysqlDb) SelectConfig

func (m *MysqlDb) SelectConfig(cxt context.Context, id int) (*model.Confing, error)

Jump to

Keyboard shortcuts

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