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: 15 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 struct

func New

func New(c *conf.Config) (s *Service)

New init

func (*Service) Close

func (s *Service) Close()

Close Service

func (*Service) GetStatByID

func (s *Service) GetStatByID(ctx context.Context, oid int64, tp int, rpID int64) (stat *model.ReplyStat, err error)

GetStatByID 从缓存获取单条评论stat获取不到则从DB获取

func (*Service) GetStatsByID

func (s *Service) GetStatsByID(ctx context.Context, oid int64, tp int, rpIDs []int64) (rs []*model.ReplyStat, err error)

GetStatsByID 从缓存获取多条评论stat获取不到则从DB获取

func (*Service) GetStatsDB

func (s *Service) GetStatsDB(ctx context.Context, oid int64, tp int) (rs []*model.ReplyStat, err error)

GetStatsDB 从数据库获取热门评论stats,这里不需要一致性,所以跨表查再聚合

func (*Service) Ping

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

Ping Service

Jump to

Keyboard shortcuts

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