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: 10 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 .

func New

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

New .

func (*Dao) AddGroup

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

AddGroup add new group.

func (*Dao) AddProduct

func (d *Dao) AddProduct(c context.Context, p *model.Product) (res int64, err error)

AddProduct add a new product.

func (*Dao) AddTarget

func (d *Dao) AddTarget(c context.Context, t *model.Target) (res int64, err error)

AddTarget add a new target.

func (*Dao) AllGroups

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

AllGroups return all groups.

func (*Dao) AllProducts

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

AllProducts return all products.

func (*Dao) AllTargets

func (d *Dao) AllTargets(c context.Context, state int) (res []*model.Target, err error)

AllTargets return all targets by state.

func (*Dao) Close

func (d *Dao) Close()

Close .

func (*Dao) CountTargets

func (d *Dao) CountTargets(c context.Context, where string) (res int, err error)

CountTargets .

func (*Dao) DeleteGroup

func (d *Dao) DeleteGroup(c context.Context, id int64) (res int64, err error)

DeleteGroup delete group.

func (*Dao) DeleteProduct

func (d *Dao) DeleteProduct(c context.Context, id int64) (res int64, err error)

DeleteProduct delete a product by id.

func (*Dao) DeleteTarget

func (d *Dao) DeleteTarget(c context.Context, id int64) (res int64, err error)

DeleteTarget delete target by id.

func (*Dao) GetMailLock

func (d *Dao) GetMailLock(c context.Context, name string, interval int, t *model.Target, code string) (ok bool, err error)

GetMailLock .

func (*Dao) Group

func (d *Dao) Group(c context.Context, id int64) (res *model.Group, err error)

Group query group by id.

func (*Dao) GroupByName

func (d *Dao) GroupByName(c context.Context, name string) (res *model.Group, err error)

GroupByName query group id by name.

func (*Dao) Groups

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

Groups query groups by ids.

func (*Dao) IsExisted

func (d *Dao) IsExisted(c context.Context, t *model.Target) (res int64, err error)

IsExisted return id if target existed by sub_event, event, product, source.

func (*Dao) Ping

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

Ping .

func (*Dao) Product

func (d *Dao) Product(c context.Context, id int64) (res *model.Product, err error)

Product get product by id.

func (*Dao) ProductByName

func (d *Dao) ProductByName(c context.Context, name string) (res *model.Product, err error)

ProductByName get product bu name.

func (*Dao) Target

func (d *Dao) Target(c context.Context, id int64) (res *model.Target, err error)

Target get target by id.

func (*Dao) TargetIncr

func (d *Dao) TargetIncr(c context.Context, t *model.Target, code string) (res int)

TargetIncr get current target error amount.

func (*Dao) TargetSync

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

TargetSync sync target state by id.

func (*Dao) TargetsByQuery

func (d *Dao) TargetsByQuery(c context.Context, where string) (res []*model.Target, err error)

TargetsByQuery query targets by query.

func (*Dao) UpdateGroup

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

UpdateGroup update group.

func (*Dao) UpdateProduct

func (d *Dao) UpdateProduct(c context.Context, p *model.Product) (res int64, err error)

UpdateProduct update product by id.

func (*Dao) UpdateTarget

func (d *Dao) UpdateTarget(c context.Context, t *model.Target) (res int64, err error)

UpdateTarget uodate target.

Jump to

Keyboard shortcuts

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