service

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service push service.

func New

func New(c *conf.Config) *Service

New creates a push service instance.

func (*Service) AddCallback

func (s *Service) AddCallback(c context.Context, cb *model.Callback) (err error)

AddCallback adds callback.

func (*Service) AddMidProgress

func (s *Service) AddMidProgress(ctx context.Context, task string, midTotal, midValid int64) error

AddMidProgress .

func (*Service) AddReport

func (s *Service) AddReport(ctx context.Context, r *model.Report) (err error)

AddReport add report.

func (*Service) AddReportCache

func (s *Service) AddReportCache(c context.Context, r *model.Report) (err error)

AddReportCache add report cache.

func (*Service) AddTokenCache

func (s *Service) AddTokenCache(ctx context.Context, r *model.Report) (err error)

AddTokenCache add token cache.

func (*Service) AddTokensCache

func (s *Service) AddTokensCache(ctx context.Context, rs map[string]*model.Report) (err error)

AddTokensCache add token cache.

func (*Service) AddUserReportCache

func (s *Service) AddUserReportCache(c context.Context, mid int64, rs []*model.Report) (err error)

AddUserReportCache add user report cache.

func (*Service) Close

func (s *Service) Close()

Close closes service.

func (*Service) DelInvalidReports

func (s *Service) DelInvalidReports(c context.Context, tp int) (err error)

DelInvalidReports deletes invalid reports.

func (*Service) DelReport

func (s *Service) DelReport(c context.Context, appID, mid int64, token string) (err error)

DelReport delelte report & its cache.

func (*Service) Filter

func (s *Service) Filter(c context.Context, content string) (res string, err error)

Filter filter content.

func (*Service) Ping

func (s *Service) Ping(c context.Context) (err error)

Ping checks service.

func (*Service) Pushs

func (s *Service) Pushs(c context.Context, task *model.Task, mids []int64) (err error)

Pushs push some mids.

func (*Service) SetSetting

func (s *Service) SetSetting(c context.Context, mid int64, typ, val int) (err error)

SetSetting saves setting.

func (*Service) Setting

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

Setting gets user notify setting.

func (*Service) SinglePush

func (s *Service) SinglePush(c context.Context, token string, task *model.Task, mid int64) (err error)

SinglePush push one mid.

func (*Service) Task

func (s *Service) Task(c context.Context, businessID int64, taskID, token string) (task *model.Task, err error)

Task gets task info.

func (*Service) TestToken

func (s *Service) TestToken(c context.Context, info *model.PushInfo, token string) (err error)

TestToken for test via push token.

func (*Service) Upimg

func (s *Service) Upimg(ctx context.Context, file multipart.File) (url string, err error)

Upimg upload image

Jump to

Keyboard shortcuts

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