Documentation
¶
Index ¶
Constants ¶
View Source
const ( SheetName = "Sheet1" ConfigFile = "诚通指标配置.xlsx" )
View Source
const RunInterval = time.Minute * 30
RunInterval 默认每隔半小时跑一次
View Source
const WebService = "http://106.37.165.121/inf/chengtong/py/sy/baseTargetValue/saveRequest"
WebService 远程数据库服务器接口
Variables ¶
This section is empty.
Functions ¶
func Generator ¶
func Generator(ec ExcelConfig, responses []model.Response, targetValueCut bool) (data []model.DataBase)
Generator 数据生成器,将配置文件数据和爬虫数据组合在一起 ec:每个指标的配置 responses:每个指标爬取的数据 targetValueCut:指标值是否要切分 - 如汇率、股票等数据,因为指标值包含最高、最低、开盘、收盘、涨幅等多个值,故多个值以逗号分隔当作一体发送给Java服务器 - 如GDP、CPI等数据,因为指标值只包含一个值
func RunTargetSelenium ¶
func RunTargetSelenium()
Types ¶
type ExcelConfig ¶
type ExcelConfig struct { Enable bool // 是否启用 TargetCode string // 指标编码 TargetName string // 指标名称 TargetNameSpider string // 指标名称_爬虫程序 TargetNameEn string // 指标名称英文 DataSourceCode string // 数据源代码 DataSourceName string // 数据源名称 SourceTargetCodeSpider string // 来源系统指标编号_爬虫程序 SourceTargetCode string // 来源系统指标编号 IsQuantity string // 是否定量 UnitType string // 计量单位类型 UnitName string // 计量单位名称 PeriodType string // 指标期间类型 PeriodName string // 指标期间名称 SpiderTime string // 爬虫时间 Adapter string // 适配 }
ExcelConfig Excel配置
Source Files
¶
Click to show internal directories.
Click to hide internal directories.