define

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERROR_STATUS_NULL                  string = "一切正常"
	ERROR_STATUS_NETWORK               string = "网络故障"
	ERROR_STATUS_INIT_NETWORK_FAILED   string = "初始化网络组件错误"
	ERROR_STATUS_API_NOT_READY         string = "目标接口未就绪"
	ERROR_STATUS_DECODE_CAHRSET_FAILED string = "解析内容编码出错"
	ERROR_STATUS_PARSE_CONTENT_FAILED  string = "解析文档出错"
)
View Source
const GLOBAL_REQ_TIMEOUT = 5 * time.Second
View Source
const GLOBAL_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorCode

type ErrorCode int
const (
	ERROR_CODE_NULL                  ErrorCode = 0
	ERROR_CODE_NETWORK               ErrorCode = 1
	ERROR_CODE_INIT_NETWORK_FAILED   ErrorCode = 2
	ERROR_CODE_API_NOT_READY         ErrorCode = 3
	ERROR_CODE_DECODE_CAHRSET_FAILED ErrorCode = 4
	ERROR_CODE_PARSE_CONTENT_FAILED  ErrorCode = 5
)

type Item

type Item struct {
	Title       string `json:"title"`
	Link        string `json:"link"`
	Date        string `json:"date"`
	Author      string `json:"author,omitempty"`
	Category    string `json:"category,omitempty"`
	Description string `json:"description,omitempty"`
	Content     string `json:"content,omitempty"`
}

type Response

type Response struct {
	Code   ErrorCode `json:"code"`
	Status string    `json:"status"`
	Date   time.Time `json:"date"`
	Data   []Item    `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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