dao

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

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

Dao struct info of Dao.

func New

func New(c *conf.Config) (d *Dao)

New new a Dao and return.

func (*Dao) BeginTx

func (d *Dao) BeginTx(c context.Context) (*xsql.Tx, error)

BeginTx begin transaction.

func (*Dao) Close

func (d *Dao) Close()

Close close connections of mc, redis, db.

func (*Dao) Ping

func (d *Dao) Ping(ctx context.Context) (err error)

Ping ping health of db.

func (*Dao) PubBatch

func (d *Dao) PubBatch(ctx context.Context, l *model.ModelSend) (err error)

PubBatch pub batch sms to databus

func (*Dao) PubSingle

func (d *Dao) PubSingle(ctx context.Context, l *model.ModelSend) (err error)

PubSingle pub single sms to databus

func (*Dao) TemplateByStatus

func (d *Dao) TemplateByStatus(ctx context.Context, status int) (res []*model.ModelTemplate, err error)

TemplateByStatus select template by status

func (*Dao) TxTask

func (d *Dao) TxTask(tx *xsql.Tx) (t *model.ModelTask, err error)

TxTask gets prepared task.

func (*Dao) TxUpdateTaskStatus

func (d *Dao) TxUpdateTaskStatus(tx *xsql.Tx, taskID int64, status int32) (err error)

TxUpdateTaskStatus updates task status by tx.

func (*Dao) UpdateTaskStatus

func (d *Dao) UpdateTaskStatus(ctx context.Context, taskID int64, status int32) (err error)

UpdateTaskStatus updates task status.

Jump to

Keyboard shortcuts

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