Documentation ¶
Overview ¶
Package chinabond 接口封装 https://yield.chinabond.com.cn/cbweb-mn/yield_main?locale=zh_CN
Index ¶
- type ChinaBond
- func (c ChinaBond) QueryAAACompanyBondSyl(ctx context.Context) float64
- func (c ChinaBond) QueryCurrentSyl(ctx context.Context, bondName string) (float64, error)
- func (c ChinaBond) QueryFxsyl(ctx context.Context, treeItemID, date string) ([][]float64, error)
- func (c ChinaBond) QueryTree(ctx context.Context) (map[string]string, error)
- type RespQueryFxsyl
- type RespQueryTree
- type TreeItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChinaBond ¶
ChinaBond 中国债券信息网
func (ChinaBond) QueryAAACompanyBondSyl ¶
QueryAAACompanyBondSyl AAA公司债当期收益率
func (ChinaBond) QueryCurrentSyl ¶
QueryCurrentSyl 返回债券当期收益率 债券名称:https://yield.chinabond.com.cn/cbweb-mn/yield_main?locale=zh_CN
func (ChinaBond) QueryFxsyl ¶
QueryFxsyl 查询指定债券在指定日期的收益率 treeItemID 为QueryTree中对应债券的id date为string格式的指定日期:YYYY-mm-dd
type RespQueryFxsyl ¶
type RespQueryFxsyl struct { YcChartDataList []struct { YcDefID string `json:"ycDefId"` YcDefName string `json:"ycDefName"` YcYWName interface{} `json:"ycYWName"` Worktime string `json:"worktime"` SeriesData [][]float64 `json:"seriesData"` IsPoint bool `json:"isPoint"` HyCurve bool `json:"hyCurve"` Point bool `json:"point"` } `json:"ycChartDataList"` ChartDataList interface{} `json:"chartDataList"` UpThrow int `json:"upThrow"` DownThrow int `json:"downThrow"` UpOffset int `json:"upOffset"` DownOffset int `json:"downOffset"` }
RespQueryFxsyl 债券收益率接口返回结果 SeriesData: [ [期限年数, 收益率], ... ]
type RespQueryTree ¶
type RespQueryTree []TreeItem
RespQueryTree 债券曲线树 https://yield.chinabond.com.cn/cbweb-mn/yc/queryTree?locale=zh_CN 接口返回结果
Click to show internal directories.
Click to hide internal directories.