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: 11 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 answer history of Dao

func New

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

New new a Dao and return.

func (*Dao) Ab

func (d *Dao) Ab(c context.Context, id int) (res *model.AB, err error)

Ab 获取单个测试

func (*Dao) AbByIDAndGroup

func (d *Dao) AbByIDAndGroup(c context.Context, id int, group int) (res *model.AB, err error)

AbByIDAndGroup 获取单个测试

func (*Dao) ActByGroup

func (d *Dao) ActByGroup(c context.Context, group int) (res []*model.AB, err error)

ActByGroup 根据group获取当前激活项目

func (*Dao) AddAb

func (d *Dao) AddAb(c context.Context, name, desc string, stra string, seed, result, group int, username string) (newID int64, err error)

AddAb 添加AB实验

func (*Dao) AddGroup

func (d *Dao) AddGroup(c context.Context, g model.Group) (i int, err error)

AddGroup add a new group

func (*Dao) Close

func (d *Dao) Close()

Close close connections.

func (*Dao) CountAb

func (d *Dao) CountAb(c context.Context, mstatus string) (count int, err error)

CountAb 获取测试数量

func (*Dao) CountAbByGroup

func (d *Dao) CountAbByGroup(c context.Context, mstatus string, group int) (count int, err error)

CountAbByGroup 获取测试数量

func (*Dao) DelAb

func (d *Dao) DelAb(c context.Context, id int) (rowsAffected int64, err error)

DelAb 删除AB实验

func (*Dao) DeleteGroup

func (d *Dao) DeleteGroup(c context.Context, id int) (i int, err error)

DeleteGroup delete the group by id

func (*Dao) GetFromRedis

func (d *Dao) GetFromRedis(c context.Context, key string) (value int, err error)

GetFromRedis .

func (*Dao) Incr

func (d *Dao) Incr(c context.Context, key string)

Incr stat result, save to redis

func (*Dao) ListAb

func (d *Dao) ListAb(c context.Context, offset, size int, mstatus string) (res []*model.AB, count int, err error)

ListAb 分页获取所有测试列表

func (*Dao) ListAbByGroup

func (d *Dao) ListAbByGroup(c context.Context, offset, size int, mstatus string, group int) (res []*model.AB, count int, err error)

ListAbByGroup 分页获取分组测试列表

func (*Dao) ListGroup

func (d *Dao) ListGroup(c context.Context) (res []*model.Group, err error)

ListGroup list all groups

func (*Dao) Move

func (d *Dao) Move(c context.Context, key string)

Move backup key

func (*Dao) Ping

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

Ping ping health.

func (*Dao) PingRedis

func (d *Dao) PingRedis(c context.Context) (err error)

PingRedis check redis connection

func (*Dao) RedisVersionID

func (d *Dao) RedisVersionID(c context.Context, group int) (ver int64, err error)

RedisVersionID 获取redis中的分组版本

func (*Dao) SetnxRedisVersionID

func (d *Dao) SetnxRedisVersionID(c context.Context, group int, v int64) (err error)

SetnxRedisVersionID 使用v设置redis中的版本号

func (*Dao) UpAb

func (d *Dao) UpAb(c context.Context, id int, name, desc string, stra string, result int, username string, newVersion, status, group int) (rowsAffected int64, err error)

UpAb 更新AB实验

func (*Dao) UpStatus

func (d *Dao) UpStatus(c context.Context, id, status int, username string, group int) (rowsAffected int64, err error)

UpStatus 更新AB实验状态

func (*Dao) UpdateGroup

func (d *Dao) UpdateGroup(c context.Context, g model.Group) (i int, err error)

UpdateGroup update group by id

func (*Dao) UpdateRedisVersionID

func (d *Dao) UpdateRedisVersionID(c context.Context, group int, v int64) (err error)

UpdateRedisVersionID 使用v更新redis中的分组版本

Jump to

Keyboard shortcuts

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