resource

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

func PromError

func PromError(name string, format string, args ...interface{})

PromError err

Types

type Dao

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

Dao struct

func New

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

New init mysql db

func (*Dao) ActVideoMTimeCount

func (dao *Dao) ActVideoMTimeCount(c context.Context) (mtime xtime.Time, err error)

ActVideoMTimeCount dao

func (*Dao) AdVideoMTimeCount

func (dao *Dao) AdVideoMTimeCount(c context.Context, now time.Time) (mtime xtime.Time, err error)

AdVideoMTimeCount dao

func (*Dao) AllVideoActive

func (dao *Dao) AllVideoActive(c context.Context, now time.Time) (ads []resource.VideoAD, err error)

AllVideoActive dao

func (*Dao) Assignment

func (dao *Dao) Assignment(c context.Context) (asgs []*resource.Assignment, err error)

Assignment get assigment from db

func (*Dao) BeginTran

func (dao *Dao) BeginTran(c context.Context) (tx *xsql.Tx, err error)

BeginTran Dao

func (*Dao) Close

func (dao *Dao) Close()

Close close the resource.

func (*Dao) DefaultBanner

func (dao *Dao) DefaultBanner(c context.Context) (asg *resource.Assignment, err error)

DefaultBanner set

func (*Dao) DelAllVideo

func (dao *Dao) DelAllVideo(c context.Context) (err error)

DelAllVideo dao

func (*Dao) Ping

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

Ping Dao

func (*Dao) Resources

func (dao *Dao) Resources(c context.Context) (rscs []*resource.Res, err error)

Resources get resource infos from db

func (*Dao) TxInsertVideo

func (dao *Dao) TxInsertVideo(tx *xsql.Tx, vad resource.VideoAD) (err error)

TxInsertVideo dao

func (*Dao) VideoAds

func (dao *Dao) VideoAds(c context.Context) (vads map[int64][]*resource.VideoAD, err error)

VideoAds dao

Jump to

Keyboard shortcuts

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