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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromChanLen

func PromChanLen(name string, length int64)

PromChanLen channel length

func PromError

func PromError(name string)

PromError prom error

func PromInfo

func PromInfo(name string)

PromInfo add prom info

Types

type Dao

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

Dao .

func New

func New(c *conf.Config) *Dao

New creates a push-service DAO instance.

func (*Dao) AddCallback

func (d *Dao) AddCallback(c context.Context, cb *model.Callback) (err error)

AddCallback adds callback.

func (*Dao) AddReport

func (d *Dao) AddReport(ctx context.Context, r *model.Report) (id int64, err error)

AddReport adds report.

func (*Dao) AddReportsCacheByMids

func (d *Dao) AddReportsCacheByMids(c context.Context, mrs map[int64][]*model.Report) (err error)

AddReportsCacheByMids add report cache by mids.

func (*Dao) AddTask

func (d *Dao) AddTask(c context.Context, t *model.Task) (id int64, err error)

AddTask adds task.

func (*Dao) AddTokenCache

func (d *Dao) AddTokenCache(c context.Context, id string, val *model.Report) (err error)

AddTokenCache Set data to mc

func (*Dao) AddTokensCache

func (d *Dao) AddTokensCache(c context.Context, values map[string]*model.Report) (err error)

AddTokensCache Set data to mc

func (*Dao) BeginTx

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

BeginTx begin transaction.

func (*Dao) Businesses

func (d *Dao) Businesses(c context.Context) (res map[int64]*model.Business, err error)

Businesses gets all business info.

func (*Dao) Close

func (d *Dao) Close() (err error)

Close dao.

func (*Dao) DelMiInvalid

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

DelMiInvalid .

func (*Dao) DelMiUninstalled

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

DelMiUninstalled deletes mi uninstalled tokens.

func (*Dao) DelReport

func (d *Dao) DelReport(c context.Context, dt string) (rows int64, err error)

DelReport delete report.

func (*Dao) DelReportCache

func (d *Dao) DelReportCache(c context.Context, mid int64, appID int64, deviceToken string) (err error)

DelReportCache delete report cache.

func (*Dao) DelTokenCache

func (d *Dao) DelTokenCache(c context.Context, id string) (err error)

DelTokenCache delete data from mc

func (*Dao) OppoMessage

func (d *Dao) OppoMessage(c context.Context, info *model.PushInfo, m *oppo.Message) (res *oppo.Response, err error)

OppoMessage saves oppo message content.

func (*Dao) Ping

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

Ping check connection status.

func (*Dao) PubCallback

func (d *Dao) PubCallback(c context.Context, v []*model.Callback) (err error)

PubCallback add push arrive/click callback to databus.

func (*Dao) PubReport

func (d *Dao) PubReport(c context.Context, info *model.Report) (err error)

PubReport add report to databus.

func (*Dao) PushFCM

func (d *Dao) PushFCM(ctx context.Context, info *model.PushInfo, scheme string, tokens []string) (res *fcm.Response, err error)

PushFCM .

func (*Dao) PushHuawei

func (d *Dao) PushHuawei(c context.Context, info *model.PushInfo, scheme string, tokens []string) (res *huawei.Response, err error)

PushHuawei push huawei notifications.

func (*Dao) PushIPad

func (d *Dao) PushIPad(c context.Context, info *model.PushInfo, item *model.PushItem) (res *model.HTTPResponse, err error)

PushIPad .

func (*Dao) PushIPhone

func (d *Dao) PushIPhone(c context.Context, info *model.PushInfo, item *model.PushItem) (res *model.HTTPResponse, err error)

PushIPhone .

func (*Dao) PushJpush

func (d *Dao) PushJpush(c context.Context, info *model.PushInfo, scheme string, tokens []string) (res *jpush.PushResponse, err error)

PushJpush push huawei notifications.

func (*Dao) PushMi

func (d *Dao) PushMi(c context.Context, info *model.PushInfo, scheme, tokens string) (res *model.HTTPResponse, err error)

PushMi .

func (*Dao) PushMiByMids

func (d *Dao) PushMiByMids(c context.Context, info *model.PushInfo, scheme, mids string) (res *model.HTTPResponse, err error)

PushMiByMids .

func (*Dao) PushOppo

func (d *Dao) PushOppo(c context.Context, info *model.PushInfo, msgID string, tokens []string) (res *oppo.Response, err error)

PushOppo push oppo notifications.

func (*Dao) PushOppoOne

func (d *Dao) PushOppoOne(c context.Context, info *model.PushInfo, m *oppo.Message, token string) (res *oppo.Response, err error)

PushOppoOne push oppo notifications.

func (*Dao) Report

func (d *Dao) Report(c context.Context, dt string) (r *model.Report, err error)

Report gets report by device_token.

func (*Dao) ReportByID

func (d *Dao) ReportByID(c context.Context, id int64) (r *model.Report, err error)

ReportByID gets report by id.

func (*Dao) Reports

func (d *Dao) Reports(c context.Context, dts []string) (rs []*model.Report, err error)

Reports gets reports by device_token.

func (*Dao) ReportsByID

func (d *Dao) ReportsByID(c context.Context, ids []int64) (reports []*model.Report, err error)

ReportsByID gets reports by mids.

func (*Dao) ReportsByMid

func (d *Dao) ReportsByMid(c context.Context, mid int64) (res []*model.Report, err error)

ReportsByMid gets reports by mid.

func (*Dao) ReportsByMids

func (d *Dao) ReportsByMids(c context.Context, mids []int64) (reports map[int64][]*model.Report, err error)

ReportsByMids gets reports by mids.

func (*Dao) ReportsCacheByMid

func (d *Dao) ReportsCacheByMid(c context.Context, mid int64) (res []*model.Report, err error)

ReportsCacheByMid gets reports cache by mid.

func (*Dao) ReportsCacheByMids

func (d *Dao) ReportsCacheByMids(c context.Context, mids []int64) (res map[int64][]*model.Report, missed []int64, err error)

ReportsCacheByMids get report cache by mids.

func (*Dao) SetSetting

func (d *Dao) SetSetting(c context.Context, mid int64, st map[int]int) (err error)

SetSetting saves user notify settings.

func (*Dao) Setting

func (d *Dao) Setting(c context.Context, mid int64) (st map[int]int, err error)

Setting gets user push setting.

func (*Dao) Task

func (d *Dao) Task(c context.Context, taskID string) (t *model.Task, err error)

Task loads task by task id.

func (*Dao) TokenCache

func (d *Dao) TokenCache(c context.Context, id string) (res *model.Report, err error)

TokenCache get data from mc

func (*Dao) TokensCache

func (d *Dao) TokensCache(ctx context.Context, tokens []string) (res map[string]*model.Report, missed []string, err error)

TokensCache get reports cache by tokens

func (*Dao) TxTaskByPlatform

func (d *Dao) TxTaskByPlatform(tx *xsql.Tx, platform int) (t *model.Task, err error)

TxTaskByPlatform gets prepared task by platform.

func (*Dao) TxUpdateTaskStatus

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

TxUpdateTaskStatus updates task status by tx.

func (*Dao) UpdateReport

func (d *Dao) UpdateReport(ctx context.Context, r *model.Report) (err error)

UpdateReport update report.

func (*Dao) UpdateTaskProgress

func (d *Dao) UpdateTaskProgress(c context.Context, taskID string, p *model.Progress) (err error)

UpdateTaskProgress updates task's progress.

func (*Dao) UpdateTaskStatus

func (d *Dao) UpdateTaskStatus(c context.Context, taskID string, status int8) (err error)

UpdateTaskStatus update task status.

Directories

Path Synopsis
Package apns2 is a go Apple Push Notification Service (APNs) provider that allows you to send remote notifications to your iOS, tvOS, and OS X apps, using the new APNs HTTP/2 network protocol.
Package apns2 is a go Apple Push Notification Service (APNs) provider that allows you to send remote notifications to your iOS, tvOS, and OS X apps, using the new APNs HTTP/2 network protocol.

Jump to

Keyboard shortcuts

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