server

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNewsContent

func GetNewsContent(publishTime time.Time) (e error, content []string)

gocn news

func GetNotify added in v0.0.6

func GetNotify(software, token string) (msgpush.NotifyPush, error)

Types

type GoCnNew2023 added in v0.0.9

type GoCnNew2023 struct {
	Client *resty.Client
}

func NewGoCnNew2023 added in v0.0.9

func NewGoCnNew2023(client *resty.Client) *GoCnNew2023

func (*GoCnNew2023) GetNewsContent added in v0.0.9

func (g *GoCnNew2023) GetNewsContent(publishTime time.Time) (error, []string)

type GoCnNewsData2023 added in v0.0.9

type GoCnNewsData2023 struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data struct {
		List []NewTopic2023 `json:"list"`
	} `json:"data"`
}

type GocnNew added in v0.0.6

type GocnNew struct {
	Client *resty.Client
}

func NewGocnNew added in v0.0.6

func NewGocnNew(client *resty.Client) *GocnNew

func (*GocnNew) GetNewsContent added in v0.0.6

func (g *GocnNew) GetNewsContent(publishTime time.Time) (error, []string)

type NewTopic2023 added in v0.0.9

type NewTopic2023 struct {
	GUID      string `json:"guid"`
	Name      string `json:"name"` // title
	UID       int    `json:"uid"`
	Ctime     int    `json:"ctime"`
	CntView   int    `json:"cntView"`
	CmtGUID   string `json:"cmtGuid"`
	SpaceGUID string `json:"spaceGuid"`
	Format    int    `json:"format"`
	Content   string `json:"content"` // 正文
}

type NewsPush added in v0.0.6

type NewsPush struct {
	Pre     string
	Notifys []msgpush.NotifyPush
}

func (*NewsPush) InitNotifys added in v0.0.6

func (n *NewsPush) InitNotifys() error

func (*NewsPush) Push added in v0.0.6

func (n *NewsPush) Push()

type Node added in v0.0.9

type Node struct {
	Type     string  `json:"type"`
	Children []*Node `json:"children"`
	Text     string  `json:"text"`
}

type Pagination added in v0.0.6

type Pagination struct {
	Total       int    `json:"total"`
	CurrentPage int    `json:"currentPage"`
	PageSize    int    `json:"pageSize"`
	Sort        string `json:"sort"`
}

type Scheduler

type Scheduler struct {
	C *cron.Cron
}

func NewScheduler

func NewScheduler() *Scheduler

NewScheduler 创建调度器

func (*Scheduler) InitJob

func (s *Scheduler) InitJob()

func (*Scheduler) Run

func (s *Scheduler) Run()

func (*Scheduler) Stop

func (s *Scheduler) Stop() context.Context

type Tdk added in v0.0.6

type Tdk struct {
	Title       string `json:"title"`
	Keywords    string `json:"keywords"`
	Description string `json:"description"`
}

type TokenEnable added in v0.0.6

type TokenEnable struct {
	Enable bool   `json:"enable"`
	Token  string `json:"token"`
}

type Topic added in v0.0.6

type Topic struct {
	GUID        string `json:"guid"`
	UID         int    `json:"uid"`
	Nickname    string `json:"nickname"`
	Avatar      string `json:"avatar"`
	Title       string `json:"title"`
	ContentHTML string `json:"contentHtml"`
	Ctime       int    `json:"ctime"`
	CntView     int    `json:"cntView"`
	Cate2ID     int    `json:"cate2Id"`
	Cate2Title  string `json:"cate2Title"`
}

type TopicInfoData added in v0.0.6

type TopicInfoData struct {
	Tdk   Tdk   `json:"tdk"`
	Topic Topic `json:"topic"`
}

type TopicInfoResp added in v0.0.6

type TopicInfoResp struct {
	Code int           `json:"code"`
	Msg  string        `json:"msg"`
	Data TopicInfoData `json:"data"`
}

type TopicList added in v0.0.6

type TopicList struct {
	GUID       string `json:"guid"`
	UID        int    `json:"uid"`
	Nickname   string `json:"nickname"`
	Avatar     string `json:"avatar"`
	Title      string `json:"title"`
	Summary    string `json:"summary"`
	Ctime      int    `json:"ctime"`
	CntView    int    `json:"cntView"`
	Cate2ID    int    `json:"cate2Id"`
	Cate2Title string `json:"cate2Title"`
	CntLike    int    `json:"cntLike,omitempty"`
	CntCollect int    `json:"cntCollect,omitempty"`
	CntReply   int    `json:"cntReply,omitempty"`
}

type TopicListData added in v0.0.6

type TopicListData struct {
	List       []TopicList `json:"list"`
	Pagination Pagination  `json:"pagination"`
}

type TopicListResp added in v0.0.6

type TopicListResp struct {
	Code int           `json:"code"`
	Msg  string        `json:"msg"`
	Data TopicListData `json:"data"`
}

Jump to

Keyboard shortcuts

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