Documentation ¶
Overview ¶
Config.go
Index ¶
- Constants
- func Count(str, pos string) int
- func GetDataByTradingDay(tradingDayInfo *TradingDayInfo) bool
- func GetDataFromDb() bool
- func GetStockLastestUpdateTime() string
- func ProcessBasicInstCode(tradingDayInfo TradingDayInfo) []byte
- func ProcessHttpFun(tradingDayInfo TradingDayInfo, ftdc []FtdcInstrument) []byte
- func ProcessHttpFunc(tradingDayInfo TradingDayInfo, strStockVer string, ftdc []FtdcInstrument) []byte
- func QueryAdditionalInstCode(w http.ResponseWriter, r *http.Request)
- func QueryBasicInstCode(w http.ResponseWriter, r *http.Request)
- func QueryInstCode(w http.ResponseWriter, r *http.Request)
- func RemoveAll(m map[string]InstCodeInfo)
- func ResultMsg(errorCode int, errorMsg string) (outJson string)
- func SearchInstCodeByKey(w http.ResponseWriter, r *http.Request)
- func Split(s []string) string
- func StringToUnxi(str string) int64
- func Strncasecmp(source string, compare string, n int) bool
- func Substr(str string, start int, length int) string
- func TradeTimes2TimeTs(exchangeTradingDay ExchangeTradingDay) string
- type Basic
- type Comment
- type Config
- type DBConfig
- type ErrorCode
- type ExchangeTradingDay
- type FtdcInstrument
- type FtdcTradingDay
- type IcCodeInfo
- type InCodeInfo
- type InstCodeInfo
- type InstCodeInfoData
- type InstInfo
- type LogInfo
- type LogWriter
- type ReqInstCode
- type TDInfo
- type TDInfoData
- type TDInfoStock
- type TradingDayInfo
Constants ¶
View Source
const ( DEBUG = iota INFO ERROR WARN )
View Source
const ( ERROR_CODE_SUCCESS = iota //成功,正确 value --> 0 ERROR_CODE_VER_SAME // 版本号相同 value --> 1 ERROR_CODE_MISS_VER //value --> 2 ERROR_CODE_JSON_FORMAT_INVALID //value --> 3 ERROR_CODE_UNKNOWN_REQ //value --> 4 ERROR_CODE_INVALID_HTTP_REQ //value --> 5 ERROR_CODE_UNSUPPORT_PERIOD //value --> 6 ERROR_CODE_MISS_DATAS //value --> 7 ERROR_CODE_DATAS_NOT_OBJECT //value --> 8 ERROR_CODE_MISS_EI //value --> 9 ERROR_CODE_MISS_PERIOD //value --> 10 ERROR_CODE_MISS_QRYDAY //value --> 11 ERROR_CODE_MISS_DAYNUM //value --> 12 ERROR_CODE_DAYNUM_BEYOND //value --> 13 ERROR_CODE_NOT_FIND_DATA //value --> 14 ERROR_CODE_NOT_INNER_CODE //value --> 15 ERROR_CODE_JSON_PARAM_INVALID //value --> 16 ERROR_CODE_JSON_PARAM_ERROR //value --> 17 ERROR_CODE_CACHEDB_ERROR //value --> 18 ERROR_CODE_DBEXCETION //value --> 19 ERROR_CODE_RELOADKLINE_MAXLIMITS //value --> 20 )
Variables ¶
This section is empty.
Functions ¶
func GetDataByTradingDay ¶
func GetDataByTradingDay(tradingDayInfo *TradingDayInfo) bool
func GetDataFromDb ¶
func GetDataFromDb() bool
func GetStockLastestUpdateTime ¶
func GetStockLastestUpdateTime() string
func ProcessBasicInstCode ¶
func ProcessBasicInstCode(tradingDayInfo TradingDayInfo) []byte
func ProcessHttpFun ¶
func ProcessHttpFun(tradingDayInfo TradingDayInfo, ftdc []FtdcInstrument) []byte
func ProcessHttpFunc ¶
func ProcessHttpFunc(tradingDayInfo TradingDayInfo, strStockVer string, ftdc []FtdcInstrument) []byte
func QueryAdditionalInstCode ¶
func QueryAdditionalInstCode(w http.ResponseWriter, r *http.Request)
func QueryBasicInstCode ¶
func QueryBasicInstCode(w http.ResponseWriter, r *http.Request)
func QueryInstCode ¶
func QueryInstCode(w http.ResponseWriter, r *http.Request)
func SearchInstCodeByKey ¶
func SearchInstCodeByKey(w http.ResponseWriter, r *http.Request)
func Strncasecmp ¶
strncasecmp忽略大小写比较字符串
func TradeTimes2TimeTs ¶
func TradeTimes2TimeTs(exchangeTradingDay ExchangeTradingDay) string
Types ¶
type Basic ¶
type Comment ¶
type Comment struct { Stock []TDInfoStock `json:"stock"` Data []TDInfoData `json:"data"` }
type Config ¶
type Config struct { XmlName xml.Name `xml:"config"` Basic Basic `xml:"basic"` DBConfig DBConfig `xml:"dbconfig"` }
var (
SysConfig Config
)
func (Config) MySqlSource ¶
type ExchangeTradingDay ¶
type FtdcInstrument ¶
type FtdcInstrument struct { Id int64 `orm:"column(ID)"` SecurityCode string `orm:"column(SecurityCode)"` //股票代码 SecurityName string `orm:"column(SecurityName)"` // 股票中文名称 SecurityType string `orm:"column(SecurityType)"` // 股票类型 ShortName string `orm:"column(ShortName)"` // 合约名称 EPS float64 `orm:"column(EPS)"` // 最近年度摊薄每股收益(eps) NAV float64 `orm:"column(NAV)"` // 每股净资产 PriceUnit string `orm:"column(PriceUnit)"` // 计价单位(CNY,US,HK) LaunchPrice float64 `orm:"column(LaunchPrice)"` // 发行价 Status int `orm:"column(Status)"` // 状态【0-无该记录 1-上市正常交易 2-未上市 3-退市】 DecimalNum int `orm:"column(DecimalNum)"` // 价格小数点后有效位数 DbInsertTime string `orm:"column(DbInsertTime)"` // 数据库插入时间 RZRQ int `orm:"column(RZRQ)"` // 融资融券标志 SGT int `orm:"column(SGT)"` // 深港通标志 HGT int `orm:"column(HGT)"` // 沪港通标志 GT int `orm:"column(GT)"` // 沪深港通标志 ExchangeID string `orm:"column(ExchangeID)"` // 交易所ID UsedName string `orm:"column(UsedName)"` // 曾用名 UsedShortName string `orm:"column(UsedShortName)"` // 曾用名拼音 }
/合约 t_stcode
func GetInstrumentByTradingDay ¶
func GetInstrumentByTradingDay() (int64, []FtdcInstrument)
type FtdcTradingDay ¶
type FtdcTradingDay struct { ID int64 `orm:"column(ID)"` TradingDay string `orm:"column(TradingDay)"` StartTime string `orm:"column(StartTime)"` EndTime string `orm:"column(EndTime)"` TradeTimes string `orm:"column(TradeTimes)"` }
/合约交易日 t_ftdctradingday
func GetCurrentTradingDay ¶
func GetCurrentTradingDay() (int64, []FtdcTradingDay)
type IcCodeInfo ¶
type InCodeInfo ¶
type InCodeInfo struct { ErrorCode int `json:"errorCode"` ErrorMsg string `json:"errorMsg"` Data []InstCodeInfoData `json:"data"` }
type InstCodeInfo ¶
type InstCodeInfo struct { Id int64 `json:"Ei"` SecurityCode string `json:"Inst"` SecurityName string `json:"SecNm"` SecurityType string `json:"Type"` ShortName string `json:"Py"` ExchID string `json:"ExchID"` CurrentName bool `json:"Current"` UsedName string `json:"UsedName"` UsedShortName string `json:"UsedShortName"` }
func SearchByPrefix ¶
func SearchByPrefix(prefix string, map_result map[string]InstCodeInfo, max_result_size int64) (ret bool, ICInfo []InstCodeInfo)
type InstCodeInfoData ¶
type ReqInstCode ¶
type TDInfoData ¶
type TDInfoData struct { Id int64 SecurityCode string //股票代码 SecurityName string // 股票中文名称 SecurityType string // 股票类型 ShortName string // 合约名称 EPS float64 // 最近年度摊薄每股收益(eps) NAV float64 // 每股净资产 PriceUnit string // 计价单位(CNY,US,HK) LaunchPrice float64 // 发行价 Status int // 状态【0-无该记录 1-上市正常交易 2-未上市 3-退市】 DecimalNum int // 价格小数点后有效位数 DbInsertTime string // 数据库插入时间 RZRQ int // 融资融券标志 SGT int // 深港通标志 HGT int // 沪港通标志 GT int // 沪深港通标志 ExchangeID string // 交易所ID UsedName string // 曾用名 UsedShortName string // 曾用名拼音 }
type TDInfoStock ¶
type TradingDayInfo ¶
type TradingDayInfo struct { StrStockVer string StrStockCodeInfo string StrBasicCodeInfo string ExchangeTradingDay ExchangeTradingDay }
func GetTradingDayInfo ¶
func GetTradingDayInfo() TradingDayInfo
Click to show internal directories.
Click to hide internal directories.