db

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	BatchInsterCreditInfo(cxt context.Context, tx *sqlx.Tx, c []model.CreditInfo) error
	Begin(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
	GetAvailableUserSum(cxt context.Context) (int, error)
	GetCreditInfo(cxt context.Context, uid int) (*model.CreditInfo, error)
	GetGroupCount(cxt context.Context, groupname string) (int, error)
	GetGroupname(cxt context.Context) ([]string, error)
	GetNilSum(cxt context.Context, field string) (int, error)
	GetRank(cxt context.Context, uid int, field string) (int, error)
	GetRanks(cxt context.Context, field string, limit int, offset int, desc bool) ([]model.CreditInfo, error)
	GetSum(cxt context.Context) (int, error)
	InsterConfig(cxt context.Context, tx *sqlx.Tx, c *model.Confing) error
	SelectConfig(cxt context.Context, id int) (*model.Confing, error)
}

type Tx

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

func GetCxtTx

func GetCxtTx(cxt context.Context) *Tx

func NewTx

func NewTx(tx *sqlx.Tx) *Tx

func (*Tx) AddAfterCommit

func (t *Tx) AddAfterCommit(f func())

func (*Tx) Transaction

func (t *Tx) Transaction(cxt context.Context, f func(cxt context.Context, tx *sqlx.Tx) error) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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