server

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(s *service.Service) (svr *rpc.Server)

New creates rpc server.

Types

type RPC

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

RPC .

func (*RPC) AddArtDraft

func (r *RPC) AddArtDraft(c context.Context, arg *model.ArgArticle, res *int64) (err error)

AddArtDraft adds or updates draft.

func (*RPC) AddArticle

func (r *RPC) AddArticle(c context.Context, arg *model.ArgArticle, res *int64) (err error)

AddArticle adds article when article passed. purge cache.

func (*RPC) AddArticleCache

func (r *RPC) AddArticleCache(c context.Context, arg *model.ArgAid, res *struct{}) (err error)

AddArticleCache adds article cache.

func (*RPC) ArtDraft

func (r *RPC) ArtDraft(c context.Context, arg *model.ArgAidMid, res *model.Draft) (err error)

ArtDraft get article draft

func (*RPC) ArticleMetas

func (r *RPC) ArticleMetas(c context.Context, arg *model.ArgAids, res *map[int64]*model.Meta) (err error)

ArticleMetas list article metas

func (*RPC) ArticleRemainCount

func (r *RPC) ArticleRemainCount(c context.Context, arg *model.ArgMid, res *int) (err error)

ArticleRemainCount returns the number that user could be use to posting new articles.

func (*RPC) Auth

func (r *RPC) Auth(c context.Context, arg *rpc.Auth, res *struct{}) (err error)

Auth check connection success.

func (*RPC) Categories

func (r *RPC) Categories(c context.Context, arg *model.ArgIP, res *model.Categories) (err error)

Categories list article categories

func (*RPC) CategoriesMap

func (r *RPC) CategoriesMap(c context.Context, arg *model.ArgIP, res *map[int64]*model.Category) (err error)

CategoriesMap list article categories map

func (*RPC) CreationArticle

func (r *RPC) CreationArticle(c context.Context, arg *model.ArgAidMid, res *model.Article) (err error)

CreationArticle gets article info.

func (*RPC) CreationUpStat

func (r *RPC) CreationUpStat(c context.Context, arg *model.ArgMid, res *model.UpStat) (err error)

CreationUpStat creation up stat

func (*RPC) CreationUpThirtyDayStat

func (r *RPC) CreationUpThirtyDayStat(c context.Context, arg *model.ArgMid, res *[]*model.ThirtyDayArticle) (err error)

CreationUpThirtyDayStat creation up thirty day stat

func (*RPC) CreationUpperArticles

func (r *RPC) CreationUpperArticles(c context.Context, arg *model.ArgCreationArts, res *model.CreationArts) (err error)

CreationUpperArticles gets upper's article list for creation center.

func (*RPC) CreationWithdrawArticle

func (r *RPC) CreationWithdrawArticle(c context.Context, arg *model.ArgAidMid, res *struct{}) (err error)

CreationWithdrawArticle author withdraw model.

func (*RPC) DelArtDraft

func (r *RPC) DelArtDraft(c context.Context, arg *model.ArgAidMid, res *struct{}) (err error)

DelArtDraft .

func (*RPC) DelArticle

func (r *RPC) DelArticle(c context.Context, arg *model.ArgAidMid, res *struct{}) error

DelArticle drops article when article not passed. purge cache.

func (*RPC) DelArticleCache

func (r *RPC) DelArticleCache(c context.Context, arg *model.ArgAidMid, res *struct{}) (err error)

DelArticleCache adds article cache.

func (*RPC) DelRecommendArtCache

func (r *RPC) DelRecommendArtCache(c context.Context, arg *model.ArgAidCid, res *struct{}) (err error)

DelRecommendArtCache del recommend article cache

func (*RPC) Favorites

func (r *RPC) Favorites(c context.Context, arg *model.ArgFav, res *[]*model.Favorite) (err error)

Favorites list user's favorite articles

func (*RPC) HadLikesByMid

func (r *RPC) HadLikesByMid(c context.Context, arg *model.ArgMidAids, res *map[int64]int8) (err error)

HadLikesByMid check user if has liked articles

func (*RPC) IsAuthor

func (r *RPC) IsAuthor(c context.Context, arg *model.ArgMid, res *bool) (err error)

IsAuthor checks that whether user has permission to write model.

func (*RPC) NewArticleCount

func (r *RPC) NewArticleCount(c context.Context, arg *model.ArgNewArt, res *int64) (err error)

NewArticleCount get new article count since given pubtime

func (*RPC) Ping

func (r *RPC) Ping(c context.Context, arg *struct{}, res *struct{}) (err error)

Ping checks connection success.

func (*RPC) RebuildAllListReadCount

func (r *RPC) RebuildAllListReadCount(c context.Context, arg *struct{}, res *struct{}) (err error)

RebuildAllListReadCount rebuild all list read count

func (*RPC) Recommends

func (r *RPC) Recommends(c context.Context, arg *model.ArgRecommends, res *[]*model.Meta) (err error)

Recommends list recommend articles

func (*RPC) SetStat

func (r *RPC) SetStat(c context.Context, arg *model.ArgStats, res *struct{}) (err error)

SetStat set all stat cache(redis)

func (*RPC) UpArtMetas

func (r *RPC) UpArtMetas(c context.Context, arg *model.ArgUpArts, res *model.UpArtMetas) (err error)

UpArtMetas list up article metas

func (*RPC) UpLists

func (r *RPC) UpLists(c context.Context, arg *model.ArgMid, res *model.UpLists) (err error)

UpLists get upper article lists

func (*RPC) UpMoreArts

func (r *RPC) UpMoreArts(c context.Context, arg *model.ArgAid, res *[]*model.Meta) (err error)

UpMoreArts get upper more arts

func (*RPC) UpdateArticle

func (r *RPC) UpdateArticle(c context.Context, arg *model.ArgArticle, res *struct{}) (err error)

UpdateArticle updates article when article passed. purge cache.

func (*RPC) UpdateArticleCache

func (r *RPC) UpdateArticleCache(c context.Context, arg *model.ArgAidCid, res *struct{}) (err error)

UpdateArticleCache adds article cache.

func (*RPC) UpdateAuthorCache

func (r *RPC) UpdateAuthorCache(c context.Context, arg *model.ArgAuthor, res *struct{}) (err error)

UpdateAuthorCache update author cache

func (*RPC) UpdateHotspots

func (r *RPC) UpdateHotspots(c context.Context, arg *model.ArgForce, res *struct{}) (err error)

UpdateHotspots update hotspots

func (*RPC) UpdateRecommends

func (r *RPC) UpdateRecommends(c context.Context, arg *model.ArgIP, res *struct{}) (err error)

UpdateRecommends refresh recommend data.

func (*RPC) UpdateSortCache

func (r *RPC) UpdateSortCache(c context.Context, arg *model.ArgSort, res *struct{}) (err error)

UpdateSortCache update sort cache

func (*RPC) UpperDrafts

func (r *RPC) UpperDrafts(c context.Context, arg *model.ArgUpDraft, res *model.Drafts) (err error)

UpperDrafts get article drafts by mid

func (*RPC) UpsArtMetas

func (r *RPC) UpsArtMetas(c context.Context, arg *model.ArgUpsArts, res *map[int64][]*model.Meta) (err error)

UpsArtMetas list passed article meta of ups

Jump to

Keyboard shortcuts

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