Documentation ¶
Index ¶
- Constants
- Variables
- func BestIP()
- func CacheServers(as AllServers) error
- func Command(pool *ConnPool, factory v1.Factory) v1.Unmarshaler
- func CommandWithConn(cli *v1.Client, callback v1.Factory) v1.Unmarshaler
- func Utf8ToGbk(text []byte) string
- type AllServers
- type ConnPool
- type FinanceInfo
- type FinanceInfoPackage
- type FinanceInfoReply
- type FinanceInfoRequest
- type Hello1Package
- type Hello1Reply
- type Hello1Request
- type Hello2Package
- type Hello2Reply
- type Hello2Request
- type HistoryMinuteTime
- type HistoryMinuteTimePackage
- type HistoryMinuteTimeReply
- type HistoryMinuteTimeRequest
- type HistoryTransaction
- type HistoryTransactionPackage
- type HistoryTransactionReply
- type HistoryTransactionRequest
- type IndexBarsPackage
- type Level
- type Message
- type MinuteTime
- type MinuteTimePackage
- type MinuteTimeReply
- type MinuteTimeRequest
- type Opt
- type RawFinanceInfo
- type RawFinanceInfo1
- type RawXdxrInfo
- type Security
- type SecurityBar
- type SecurityBarsPackage
- type SecurityBarsReply
- type SecurityBarsRequest
- type SecurityCountPackage
- type SecurityCountReply
- type SecurityCountRequest
- type SecurityListPackage
- type SecurityListReply
- type SecurityListRequest
- type SecurityQuote
- type SecurityQuotesPackage
- type SecurityQuotesReply
- type SecurityQuotesRequest
- type Server
- type ServerGroup
- type StdApi
- func (this *StdApi) Close()
- func (this *StdApi) GetFinanceInfo(market proto.Market, code string, num uint16) (*FinanceInfo, error)
- func (this *StdApi) GetHistoryMinuteTimeData(market proto.Market, code string, date uint32) (*HistoryMinuteTimeReply, error)
- func (this *StdApi) GetHistoryTransactionData(market proto.Market, code string, date uint32, start uint16, count uint16) (*HistoryTransactionReply, error)
- func (this *StdApi) GetIndexBars(market proto.Market, code string, category uint16, start uint16, count uint16) (*SecurityBarsReply, error)
- func (this *StdApi) GetKLine(market proto.Market, code string, category uint16, start uint16, count uint16) (*SecurityBarsReply, error)
- func (this *StdApi) GetMinuteTimeData(market proto.Market, code string) (*MinuteTimeReply, error)
- func (this *StdApi) GetSecurityCount(market proto.Market) (*SecurityCountReply, error)
- func (this *StdApi) GetSecurityList(market proto.Market, start uint16) (*SecurityListReply, error)
- func (this *StdApi) GetSecurityQuotes(markets []proto.Market, codes []string) (*SecurityQuotesReply, error)
- func (this *StdApi) GetTransactionData(market proto.Market, code string, start uint16, count uint16) (*TransactionReply, error)
- func (this *StdApi) GetXdxrInfo(market proto.Market, code string) ([]XdxrInfo, error)
- func (this *StdApi) Hello1() (*Hello1Reply, error)
- func (this *StdApi) Hello2() (*Hello2Reply, error)
- type StdRequestHeader
- type StdResponseHeader
- type Stock
- type TcpClient
- type TdxMarket
- type TickTransaction
- type TransactionPackage
- type TransactionReply
- type TransactionRequest
- type XdxrInfo
- type XdxrInfoPackage
- type XdxrInfoReply
- type XdxrInfoRequest
Constants ¶
const ( DefaultRetryTimes = 3 // 重试次数 MessageHeaderBytes = 0x10 MessageMaxBytes = 1 << 15 )
const ( // POOL_INITED 连接池初始化 POOL_INITED = 1 // POOL_MAX 连接池最大 2 POOL_MAX = 2 // CONN_TIMEOUT 链接超时 30 s CONN_TIMEOUT = 30 )
const ( // HQ_HOSTS 标准市场 主机列表 HQ_HOSTS = `` /* 2678-byte string literal not displayed */ // EX_HOSTS 扩展市场主机列表 EX_HOSTS = `` /* 684-byte string literal not displayed */ // GP_HOSTS 财务数据 主机列表 GP_HOSTS = `[ {"name":"默认财务数据线路", "host":"120.76.152.87", "port": 7709} ]` CONFIG = `` /* 129-byte string literal not displayed */ )
const ( TDX_HOST_HQ = "HQ" TDX_HOST_EX = "EX" TDX_HOST_GP = "GP" )
Variables ¶
var (
ErrBadData = errors.New("more than 8M data")
)
var (
XDXR_CATEGORY_MAPPING = map[int]string{
1: "除权除息",
2: "送配股上市",
3: "非流通股上市",
4: "未知股本变动",
5: "股本变化",
6: "增发新股",
7: "股份回购",
8: "增发新股上市",
9: "转配股上市",
10: "可转债上市",
11: "扩缩股",
12: "非流通股缩股",
13: "送认购权证",
14: "送认沽权证",
}
)
Functions ¶
func CacheServers ¶
func CacheServers(as AllServers) error
func CommandWithConn ¶
Types ¶
type AllServers ¶
type AllServers struct { Server ServerGroup `json:"Server"` BestIP ServerGroup `json:"BestIP"` }
AllServers 全部主机
func OpenConfig ¶
func OpenConfig() *AllServers
type ConnPool ¶
type ConnPool struct {
// contains filtered or unexported fields
}
ConnPool 连接池
func NewConnPool ¶
func NewConnPool(opt Opt, size int, factory func() (interface{}, error), close func(interface{}) error, ping func(interface{}) error) (*ConnPool, error)
NewConnPool 创新一个新连接池
func (*ConnPool) ReturnConn ¶
func (p *ConnPool) ReturnConn(conn interface{})
type FinanceInfo ¶
type FinanceInfo struct { LiuTongGuBen float64 `struc:"float32,little" json:"liu_tong_gu_ben"` Province uint16 `struc:"uint16,little" json:"province"` Industry uint16 `struc:"uint16,little" json:"industry"` UpdatedDate uint32 `struc:"uint32,little" json:"updatedDate"` IPODate uint32 `struc:"uint32,little" json:"ipo_date"` ZongGuBen float64 `struc:"float32,little" json:"zong_gu_ben"` GuoJiaGu float64 `struc:"float32,little" json:"guo_jia_gu"` FaQiRenFaRenGu float64 `struc:"float32,little" json:"fa_qi_ren_fa_ren_gu"` FaRenGu float64 `struc:"float32,little" json:"fa_ren_gu"` BGu float64 `struc:"float32,little" json:"b_gu"` HGu float64 `struc:"float32,little" json:"h_gu"` ZhiGongGu float64 `struc:"float32,little" json:"zhi_gong_gu"` ZongZiChan float64 `struc:"float32,little" json:"zong_zi_chan"` LiuDongZiChan float64 `struc:"float32,little" json:"liu_dong_zi_chan"` GuDingZiChan float64 `struc:"float32,little" json:"gu_ding_zi_chan"` WuXingZiChan float64 `struc:"float32,little" json:"wu_xing_zi_chan"` GuDongRenShu float64 `struc:"float32,little" json:"gu_dong_ren_shu"` LiuDongFuZhai float64 `struc:"float32,little" json:"liu_dong_fu_zhai"` ChangQiFuZhai float64 `struc:"float32,little" json:"chang_qi_fu_zhai"` ZiBenGongJiJin float64 `struc:"float32,little" json:"zi_ben_gong_ji_jin"` JingZiChan float64 `struc:"float32,little" json:"jing_zi_chan"` ZhuYingShouRu float64 `struc:"float32,little" json:"zhu_ying_shou_ru"` ZhuYingLiRun float64 `struc:"float32,little" json:"zhu_ying_li_run"` YingShouZhangKuan float64 `struc:"float32,little" json:"ying_shou_zhang_kuan"` YingyeLiRun float64 `struc:"float32,little" json:"yingye_li_run"` TouZiShouYu float64 `struc:"float32,little" json:"tou_zi_shou_yu"` JingYingxianJinLiu float64 `struc:"float32,little" json:"jing_yingxian_jin_liu"` ZongXianJinLiu float64 `struc:"float32,little" json:"zong_xian_jin_liu"` CunHuo float64 `struc:"float32,little" json:"cun_huo"` LiRunZongHe float64 `struc:"float32,little" json:"li_run_zong_he"` ShuiHouLiRun float64 `struc:"float32,little" json:"shui_hou_li_run"` JingLiRun float64 `struc:"float32,little" json:"jing_li_run"` WeiFenLiRun float64 `struc:"float32,little" json:"wei_fen_li_run"` MeiGuJingZiChan float64 `struc:"float32,little" json:"mei_gu_jing_zi_chan"` BaoLiu2 float64 `struc:"float32,little" json:"bao_liu_2"` }
type FinanceInfoPackage ¶
type FinanceInfoPackage struct {
// contains filtered or unexported fields
}
FinanceInfoPackage 基本信息
func NewFinanceInfoPackage ¶
func NewFinanceInfoPackage() *FinanceInfoPackage
func (*FinanceInfoPackage) Reply ¶
func (obj *FinanceInfoPackage) Reply() interface{}
func (*FinanceInfoPackage) Serialize ¶
func (obj *FinanceInfoPackage) Serialize() ([]byte, error)
func (*FinanceInfoPackage) SetParams ¶
func (obj *FinanceInfoPackage) SetParams(req *FinanceInfoRequest)
func (*FinanceInfoPackage) UnSerialize ¶
func (obj *FinanceInfoPackage) UnSerialize(header interface{}, data []byte) error
type FinanceInfoReply ¶
type FinanceInfoReply struct { Count uint16 // 总数 //Market uint8 `struc:"uint8,little"` //Code [6]byte `struc:"[6]byte,little"` First RawFinanceInfo }
FinanceInfoReply 响应包结构
type FinanceInfoRequest ¶
type Hello1Package ¶
type Hello1Package struct {
// contains filtered or unexported fields
}
func NewHello1 ¶
func NewHello1() *Hello1Package
func (*Hello1Package) Reply ¶
func (obj *Hello1Package) Reply() interface{}
func (*Hello1Package) Serialize ¶
func (obj *Hello1Package) Serialize() ([]byte, error)
func (*Hello1Package) UnSerialize ¶
func (obj *Hello1Package) UnSerialize(header interface{}, data []byte) error
00e60708051 50 f0 00 d3 a02b2020c03840384038403840384033a02b2020c0384038403840384038403 00 5a8a3401 f94a0100 5a8a3401 fd4a0100ff00e 700000101013f
分 时 秒 日期
type Hello1Reply ¶
type Hello1Reply struct { Info string // contains filtered or unexported fields }
type Hello1Request ¶
type Hello1Request struct { }
type Hello2Package ¶
type Hello2Package struct {
// contains filtered or unexported fields
}
func NewHello2 ¶
func NewHello2() *Hello2Package
func (*Hello2Package) Reply ¶
func (obj *Hello2Package) Reply() interface{}
func (*Hello2Package) Serialize ¶
func (obj *Hello2Package) Serialize() ([]byte, error)
func (*Hello2Package) UnSerialize ¶
func (obj *Hello2Package) UnSerialize(header interface{}, data []byte) error
0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011f85e34068747470733a2f2f626967352e6e65776f6e652e636f6d2e636e2f7a797968742f7a645f7a737a712e7a6970000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004150503a414c4c0d0a54494d453a303a30312d31353a30352c31353a30362d32333a35390d0a20202020c4facab9d3c3b5c4b0e6b1bebcb4bdabcda3d3c3a3acceaac1cbc4fab5c4d5fdb3a3cab9d3c32cc7ebbea1bfecc9fdd6c1d5d0c9ccd6a4c8af5043b0e6a1a30d0a20202020c8e7b9fbb2bbc4dcd7d4b6afc9fdbcb6a3acc7ebb5bdb9d9cdf868747470733a2f2f7777772e636d736368696e612e636f6d2fcfc2d4d8b0b2d7b0a3acd0bbd0bbc4fab5c4d6a7b3d6a3a100 年月日 年月日
type Hello2Reply ¶
type Hello2Reply struct { Info string // contains filtered or unexported fields }
type Hello2Request ¶
type Hello2Request struct { }
type HistoryMinuteTime ¶
type HistoryMinuteTimePackage ¶
type HistoryMinuteTimePackage struct {
// contains filtered or unexported fields
}
func NewHistoryMinuteTimePackage ¶
func NewHistoryMinuteTimePackage() *HistoryMinuteTimePackage
func (*HistoryMinuteTimePackage) Reply ¶
func (obj *HistoryMinuteTimePackage) Reply() interface{}
func (*HistoryMinuteTimePackage) Serialize ¶
func (obj *HistoryMinuteTimePackage) Serialize() ([]byte, error)
func (*HistoryMinuteTimePackage) SetParams ¶
func (obj *HistoryMinuteTimePackage) SetParams(req *HistoryMinuteTimeRequest)
SetParams 设置参数
func (*HistoryMinuteTimePackage) UnSerialize ¶
func (obj *HistoryMinuteTimePackage) UnSerialize(header interface{}, data []byte) error
结果数据都是\n,\t分隔的中文字符串,比如查询K线数据,返回的结果字符串就形如 /“时间\t开盘价\t收盘价\t最高价\t最低价\t成交量\t成交额\n /20150519\t4.644000\t4.732000\t4.747000\t4.576000\t146667487\t683638848.000000\n /20150520\t4.756000\t4.850000\t4.960000\t4.756000\t353161092\t1722953216.000000”
type HistoryMinuteTimeReply ¶
type HistoryMinuteTimeReply struct { Count uint16 List []HistoryMinuteTime }
type HistoryTransaction ¶
type HistoryTransactionPackage ¶
type HistoryTransactionPackage struct {
// contains filtered or unexported fields
}
func NewHistoryTransactionPackage ¶
func NewHistoryTransactionPackage() *HistoryTransactionPackage
func (*HistoryTransactionPackage) Reply ¶
func (obj *HistoryTransactionPackage) Reply() interface{}
func (*HistoryTransactionPackage) Serialize ¶
func (obj *HistoryTransactionPackage) Serialize() ([]byte, error)
func (*HistoryTransactionPackage) SetParams ¶
func (obj *HistoryTransactionPackage) SetParams(req *HistoryTransactionRequest)
SetParams 设置参数
func (*HistoryTransactionPackage) UnSerialize ¶
func (obj *HistoryTransactionPackage) UnSerialize(header interface{}, data []byte) error
type HistoryTransactionReply ¶
type HistoryTransactionReply struct { Count uint16 List []HistoryTransaction }
type IndexBarsPackage ¶
type IndexBarsPackage struct {
// contains filtered or unexported fields
}
IndexBarsPackage 指数K线
func NewIndexBarsPackage ¶
func NewIndexBarsPackage() *IndexBarsPackage
func (*IndexBarsPackage) Reply ¶
func (obj *IndexBarsPackage) Reply() interface{}
func (*IndexBarsPackage) Serialize ¶
func (obj *IndexBarsPackage) Serialize() ([]byte, error)
func (*IndexBarsPackage) SetParams ¶
func (obj *IndexBarsPackage) SetParams(req *SecurityBarsRequest)
func (*IndexBarsPackage) UnSerialize ¶
func (obj *IndexBarsPackage) UnSerialize(header interface{}, data []byte) error
type Message ¶
type Message interface { // Serialize 编码 Serialize() ([]byte, error) // UnSerialize 解码 UnSerialize(head interface{}, in []byte) error // Reply 获取返回值 Reply() interface{} }
Message 消息接口
type MinuteTime ¶
type MinuteTimePackage ¶
type MinuteTimePackage struct {
// contains filtered or unexported fields
}
func NewMinuteTimePackage ¶
func NewMinuteTimePackage() *MinuteTimePackage
func (*MinuteTimePackage) Reply ¶
func (obj *MinuteTimePackage) Reply() interface{}
func (*MinuteTimePackage) Serialize ¶
func (obj *MinuteTimePackage) Serialize() ([]byte, error)
func (*MinuteTimePackage) SetParams ¶
func (obj *MinuteTimePackage) SetParams(req *MinuteTimeRequest)
func (*MinuteTimePackage) UnSerialize ¶
func (obj *MinuteTimePackage) UnSerialize(header interface{}, data []byte) error
结果数据都是\n,\t分隔的中文字符串,比如查询K线数据,返回的结果字符串就形如 /“时间\t开盘价\t收盘价\t最高价\t最低价\t成交量\t成交额\n /20150519\t4.644000\t4.732000\t4.747000\t4.576000\t146667487\t683638848.000000\n /20150520\t4.756000\t4.850000\t4.960000\t4.756000\t353161092\t1722953216.000000”
type MinuteTimeReply ¶
type MinuteTimeReply struct { Count uint16 List []MinuteTime }
type MinuteTimeRequest ¶
type RawFinanceInfo ¶ added in v1.1.3
type RawFinanceInfo struct { //Unknown1 [2]byte `struc:"[2]byte,little"` Market uint8 `struc:"uint8,little"` Code [6]byte `struc:"[6]byte,little"` LiuTongGuBen float32 `struc:"float32,little"` Province uint16 `struc:"uint16,little"` Industry uint16 `struc:"uint16,little"` UpdatedDate uint32 `struc:"uint32,little"` IPODate uint32 `struc:"uint32,little"` ZongGuBen float32 `struc:"float32,little"` GuoJiaGu float32 `struc:"float32,little"` FaQiRenFaRenGu float32 `struc:"float32,little"` FaRenGu float32 `struc:"float32,little"` BGu float32 `struc:"float32,little"` HGu float32 `struc:"float32,little"` ZhiGongGu float32 `struc:"float32,little"` ZongZiChan float32 `struc:"float32,little"` LiuDongZiChan float32 `struc:"float32,little"` GuDingZiChan float32 `struc:"float32,little"` WuXingZiChan float32 `struc:"float32,little"` GuDongRenShu float32 `struc:"float32,little"` LiuDongFuZhai float32 `struc:"float32,little"` ChangQiFuZhai float32 `struc:"float32,little"` ZiBenGongJiJin float32 `struc:"float32,little"` JingZiChan float32 `struc:"float32,little"` ZhuYingShouRu float32 `struc:"float32,little"` ZhuYingLiRun float32 `struc:"float32,little"` Yingshouzhangkuan float32 `struc:"float32,little"` YingyeLiRun float32 `struc:"float32,little"` TouZiShouYu float32 `struc:"float32,little"` JingYingxianJinLiu float32 `struc:"float32,little"` ZongXianJinLiu float32 `struc:"float32,little"` CunHuo float32 `struc:"float32,little"` LiRunZongHe float32 `struc:"float32,little"` ShuiHouLiRun float32 `struc:"float32,little"` JingLiRun float32 `struc:"float32,little"` WeiFenLiRun float32 `struc:"float32,little"` BaoLiu1 float32 `struc:"float32,little"` BaoLiu2 float32 `struc:"float32,little"` }
RawFinanceInfo 响应包结构
一次返回145个字节, 现在有136个字节, 空余9个字节分别是总数、市场和代码 Num每加1, 返回字节数增加143
type RawFinanceInfo1 ¶ added in v1.1.3
type RawFinanceInfo1 struct { //Unknown1 [2]byte `struc:"[2]byte,little"` //Market uint8 `struc:"uint8,little"` //Code [6]byte `struc:"[6]byte,little"` LiuTongGuBen float32 `struc:"float32,little"` Province uint16 `struc:"uint16,little"` Industry uint16 `struc:"uint16,little"` UpdatedDate uint32 `struc:"uint32,little"` IPODate uint32 `struc:"uint32,little"` ZongGuBen float32 `struc:"float32,little"` GuoJiaGu float32 `struc:"float32,little"` FaQiRenFaRenGu float32 `struc:"float32,little"` FaRenGu float32 `struc:"float32,little"` BGu float32 `struc:"float32,little"` HGu float32 `struc:"float32,little"` ZhiGongGu float32 `struc:"float32,little"` ZongZiChan float32 `struc:"float32,little"` LiuDongZiChan float32 `struc:"float32,little"` GuDingZiChan float32 `struc:"float32,little"` WuXingZiChan float32 `struc:"float32,little"` GuDongRenShu float32 `struc:"float32,little"` LiuDongFuZhai float32 `struc:"float32,little"` ChangQiFuZhai float32 `struc:"float32,little"` ZiBenGongJiJin float32 `struc:"float32,little"` JingZiChan float32 `struc:"float32,little"` ZhuYingShouRu float32 `struc:"float32,little"` ZhuYingLiRun float32 `struc:"float32,little"` Yingshouzhangkuan float32 `struc:"float32,little"` YingyeLiRun float32 `struc:"float32,little"` TouZiShouYu float32 `struc:"float32,little"` JingYingxianJinLiu float32 `struc:"float32,little"` ZongXianJinLiu float32 `struc:"float32,little"` CunHuo float32 `struc:"float32,little"` LiRunZongHe float32 `struc:"float32,little"` ShuiHouLiRun float32 `struc:"float32,little"` JingLiRun float32 `struc:"float32,little"` WeiFenLiRun float32 `struc:"float32,little"` BaoLiu1 float32 `struc:"float32,little"` BaoLiu2 float32 `struc:"float32,little"` BaoLiu3 [7]byte `struc:"[7]byte,little"` }
type RawXdxrInfo ¶ added in v1.2.4
type SecurityBar ¶
type SecurityBar struct { Open float64 Close float64 High float64 Low float64 Vol float64 Amount float64 Year int Month int Day int Hour int Minute int DateTime string }
SecurityBar K线数据
type SecurityBarsPackage ¶
type SecurityBarsPackage struct {
// contains filtered or unexported fields
}
SecurityBars K线
func NewSecurityBarsPackage ¶
func NewSecurityBarsPackage() *SecurityBarsPackage
func (*SecurityBarsPackage) Reply ¶
func (obj *SecurityBarsPackage) Reply() interface{}
func (*SecurityBarsPackage) Serialize ¶
func (obj *SecurityBarsPackage) Serialize() ([]byte, error)
func (*SecurityBarsPackage) SetParams ¶
func (obj *SecurityBarsPackage) SetParams(req *SecurityBarsRequest)
func (*SecurityBarsPackage) UnSerialize ¶
func (obj *SecurityBarsPackage) UnSerialize(header interface{}, data []byte) error
UnSerialize 结果数据都是\n,\t分隔的中文字符串,比如查询K线数据,返回的结果字符串就形如 /“时间\t开盘价\t收盘价\t最高价\t最低价\t成交量\t成交额\n /20150519\t4.644000\t4.732000\t4.747000\t4.576000\t146667487\t683638848.000000\n /20150520\t4.756000\t4.850000\t4.960000\t4.756000\t353161092\t1722953216.000000”
type SecurityBarsReply ¶
type SecurityBarsReply struct { Count uint16 List []SecurityBar }
type SecurityBarsRequest ¶
type SecurityCountPackage ¶
type SecurityCountPackage struct {
// contains filtered or unexported fields
}
SecurityCountPackage 市场股票数量
func NewSecurityCountPackage ¶
func NewSecurityCountPackage() *SecurityCountPackage
func (*SecurityCountPackage) Reply ¶
func (obj *SecurityCountPackage) Reply() interface{}
func (*SecurityCountPackage) Serialize ¶
func (obj *SecurityCountPackage) Serialize() ([]byte, error)
func (*SecurityCountPackage) SetParams ¶
func (obj *SecurityCountPackage) SetParams(req *SecurityCountRequest)
func (*SecurityCountPackage) UnSerialize ¶
func (obj *SecurityCountPackage) UnSerialize(header interface{}, data []byte) error
type SecurityCountReply ¶
type SecurityCountReply struct {
Count uint16
}
type SecurityCountRequest ¶
type SecurityCountRequest struct {
Market uint16
}
type SecurityListPackage ¶
type SecurityListPackage struct {
// contains filtered or unexported fields
}
SecurityListPackage 股票列表
func NewSecurityListPackage ¶
func NewSecurityListPackage() *SecurityListPackage
func (*SecurityListPackage) Reply ¶
func (obj *SecurityListPackage) Reply() interface{}
func (*SecurityListPackage) Serialize ¶
func (obj *SecurityListPackage) Serialize() ([]byte, error)
func (*SecurityListPackage) SetParams ¶
func (obj *SecurityListPackage) SetParams(req *SecurityListRequest)
func (*SecurityListPackage) UnSerialize ¶
func (obj *SecurityListPackage) UnSerialize(header interface{}, data []byte) error
type SecurityListReply ¶
type SecurityListRequest ¶
type SecurityQuote ¶
type SecurityQuote struct { Market uint8 // 市场 Code string // 代码 Active1 uint16 // 活跃度 Price float64 // 现价 LastClose float64 // 昨收 Open float64 // 开盘 High float64 // 最高 Low float64 // 最低 ServerTime string // 时间 ReversedBytes0 int // 保留(时间 ServerTime) ReversedBytes1 int // 保留 Vol int // 总量 CurVol int // 现量 Amount float64 // 总金额 SVol int // 内盘 BVol int // 外盘 ReversedBytes2 int // 保留 ReversedBytes3 int // 保留 BidLevels []Level AskLevels []Level Bid1 float64 Ask1 float64 BidVol1 int AskVol1 int Bid2 float64 Ask2 float64 BidVol2 int AskVol2 int Bid3 float64 Ask3 float64 BidVol3 int AskVol3 int Bid4 float64 Ask4 float64 BidVol4 int AskVol4 int Bid5 float64 Ask5 float64 BidVol5 int AskVol5 int ReversedBytes4 uint16 // 保留 ReversedBytes5 int // 保留 ReversedBytes6 int // 保留 ReversedBytes7 int // 保留 ReversedBytes8 int // 保留 Rate float64 // 涨速 Active2 uint16 // 活跃度 }
type SecurityQuotesPackage ¶
type SecurityQuotesPackage struct {
// contains filtered or unexported fields
}
SecurityQuotesPackage 盘口五档报价
func NewGetSecurityQuotesPackage ¶
func NewGetSecurityQuotesPackage() *SecurityQuotesPackage
func (*SecurityQuotesPackage) Reply ¶
func (obj *SecurityQuotesPackage) Reply() interface{}
func (*SecurityQuotesPackage) Serialize ¶
func (obj *SecurityQuotesPackage) Serialize() ([]byte, error)
func (*SecurityQuotesPackage) SetParams ¶
func (obj *SecurityQuotesPackage) SetParams(req *SecurityQuotesRequest)
func (*SecurityQuotesPackage) UnSerialize ¶
func (obj *SecurityQuotesPackage) UnSerialize(header interface{}, data []byte) error
type SecurityQuotesReply ¶
type SecurityQuotesReply struct { Count uint16 List []SecurityQuote }
type SecurityQuotesRequest ¶
type SecurityQuotesRequest struct {
StockList []Stock
}
type Server ¶
type Server struct { Name string `json:"name"` Host string `json:"host"` Port int `json:"port"` CrossTime int64 `json:"crossTime"` }
Server 主机信息
func GetFastHost ¶
type ServerGroup ¶
ServerGroup 主机组
type StdApi ¶
type StdApi struct {
// contains filtered or unexported fields
}
func NewStdApiWithServers ¶ added in v1.1.1
NewStdApiWithServers 通过服务器组创建一个标准接口
func (*StdApi) GetFinanceInfo ¶
func (this *StdApi) GetFinanceInfo(market proto.Market, code string, num uint16) (*FinanceInfo, error)
GetFinanceInfo 基本面
func (*StdApi) GetHistoryMinuteTimeData ¶
func (this *StdApi) GetHistoryMinuteTimeData(market proto.Market, code string, date uint32) (*HistoryMinuteTimeReply, error)
GetHistoryMinuteTimeData 获取历史分时图数据
func (*StdApi) GetHistoryTransactionData ¶
func (this *StdApi) GetHistoryTransactionData(market proto.Market, code string, date uint32, start uint16, count uint16) (*HistoryTransactionReply, error)
GetHistoryTransactionData 获取历史分时成交
func (*StdApi) GetIndexBars ¶
func (this *StdApi) GetIndexBars(market proto.Market, code string, category uint16, start uint16, count uint16) (*SecurityBarsReply, error)
GetIndexBars 指数K线
func (*StdApi) GetKLine ¶
func (this *StdApi) GetKLine(market proto.Market, code string, category uint16, start uint16, count uint16) (*SecurityBarsReply, error)
GetKLine K线
func (*StdApi) GetMinuteTimeData ¶
GetMinuteTimeData 获取分时图数据
func (*StdApi) GetSecurityCount ¶
func (this *StdApi) GetSecurityCount(market proto.Market) (*SecurityCountReply, error)
GetSecurityCount 获取指定市场内的证券数目
func (*StdApi) GetSecurityList ¶
GetSecurityList 股票列表
func (*StdApi) GetSecurityQuotes ¶
func (this *StdApi) GetSecurityQuotes(markets []proto.Market, codes []string) (*SecurityQuotesReply, error)
GetSecurityQuotes 获取盘口五档报价
func (*StdApi) GetTransactionData ¶
func (this *StdApi) GetTransactionData(market proto.Market, code string, start uint16, count uint16) (*TransactionReply, error)
GetTransactionData 获取分时成交
func (*StdApi) GetXdxrInfo ¶ added in v1.2.4
GetHistoryTransactionData 获取历史分时成交
func (*StdApi) Hello1 ¶
func (this *StdApi) Hello1() (*Hello1Reply, error)
func (*StdApi) Hello2 ¶
func (this *StdApi) Hello2() (*Hello2Reply, error)
type StdRequestHeader ¶
type StdRequestHeader struct { Zip uint8 // ZipFlag SeqID uint32 // 请求编号 PacketType uint8 PkgLen1 uint16 PkgLen2 uint16 Method uint16 // method 请求方法 }
StdRequestHeader 标准行情-请求-消息头
type StdResponseHeader ¶
type StdResponseHeader struct { I1 uint32 I2 uint8 SeqID uint32 // 请求编号 I3 uint8 Method uint16 // method ZipSize uint16 // 长度 UnZipSize uint16 // 未压缩长度 }
StdResponseHeader 标准行情-响应-消息头
type TickTransaction ¶
type TransactionPackage ¶
type TransactionPackage struct {
// contains filtered or unexported fields
}
TransactionPackage 当日分笔成交信息
func NewTransactionPackage ¶
func NewTransactionPackage() *TransactionPackage
func (*TransactionPackage) Reply ¶
func (obj *TransactionPackage) Reply() interface{}
func (*TransactionPackage) Serialize ¶
func (obj *TransactionPackage) Serialize() ([]byte, error)
func (*TransactionPackage) SetParams ¶
func (obj *TransactionPackage) SetParams(req *TransactionRequest)
func (*TransactionPackage) UnSerialize ¶
func (obj *TransactionPackage) UnSerialize(header interface{}, data []byte) error
type TransactionReply ¶
type TransactionReply struct { Count uint16 List []TickTransaction }
type TransactionRequest ¶
type XdxrInfo ¶ added in v1.2.4
type XdxrInfo struct { Date string // 日期 Category int // 类型 Name string // 类型名称 FenHong float64 // 分红 PeiGuJia float64 // 配股价 SongZhuanGu float64 // 送转股 PeiGu float64 // 配股 SuoGu float64 // 缩股 PanQianLiuTong float64 // 盘前流通 PanHouLiuTong float64 // 盘后流通 QianZongGuBen float64 // 前总股本 HouZongGuBen float64 // 后总股本 FenShu float64 // 份数 XingGuanJia float64 // 行权价 }
type XdxrInfoPackage ¶ added in v1.2.4
type XdxrInfoPackage struct {
// contains filtered or unexported fields
}
XdxrInfoPackage 除权除息
func NewXdxrInfoPackage ¶ added in v1.2.4
func NewXdxrInfoPackage() *XdxrInfoPackage
func (*XdxrInfoPackage) Reply ¶ added in v1.2.4
func (obj *XdxrInfoPackage) Reply() interface{}
func (*XdxrInfoPackage) Serialize ¶ added in v1.2.4
func (obj *XdxrInfoPackage) Serialize() ([]byte, error)
func (*XdxrInfoPackage) SetParams ¶ added in v1.2.4
func (obj *XdxrInfoPackage) SetParams(req *XdxrInfoRequest)
func (*XdxrInfoPackage) UnSerialize ¶ added in v1.2.4
func (obj *XdxrInfoPackage) UnSerialize(header interface{}, data []byte) error
type XdxrInfoReply ¶ added in v1.2.4
type XdxrInfoReply struct { Unknown []byte `struc:"[9]byte,little"` // 未知 Count uint16 `struc:"uint16,little,sizeof=List"` // 总数 List []RawXdxrInfo `struc:"[29]byte, little"` // [29]byte和title中间必须要有一个空格 }
XdxrInfoReply 响应包结构
type XdxrInfoRequest ¶ added in v1.2.4
Source Files ¶
- api.go
- base_client.go
- base_consts.go
- base_message.go
- base_pool.go
- bestip.go
- builtin.go
- cache.go
- cmd_hello1.go
- cmd_hello2.go
- command_v1.go
- index_bars.go
- stock_finance_info.go
- stock_minute_time_data.go
- stock_minute_time_data_history.go
- stock_security_bars.go
- stock_security_count.go
- stock_security_list.go
- stock_security_quotes.go
- stock_transaction_data.go
- stock_transaction_data_history.go
- stock_xdxr_info.go