Versions in this module Expand all Collapse all v1 v1.0.3 Jul 9, 2023 v1.0.2 Jul 9, 2023 v1.0.1 Jul 9, 2023 v1.0.0 Jul 9, 2023 Changes in this version + const BLOCK_CHUNKS_SIZE + const BLOCK_DEFAULT + const BLOCK_FENGGE + const BLOCK_GAINIAN + const BLOCK_ZHISHU + const CONN_TIMEOUT + const DefaultRetryTimes + const EX_HOSTS + const GP_HOSTS + const HQ_HOSTS + const MessageHeaderBytes + const MessageMaxBytes + const POOL_INITED + const POOL_MAX + const RECV_TIMEOUT + const TDX_HOST_EX + const TDX_HOST_GP + const TDX_HOST_HQ + const TDX_SECURITY_BARS_MAX + const TDX_SECURITY_LIST_MAX + const TDX_SECURITY_QUOTES_MAX + const TDX_SECURITY_QUOTES_MAX_V2 + const TDX_TRANSACTION_MAX + var DefaultEXServer = DefaultHQServer + var DefaultHQServer = Server + var ErrBadData = errors.New("more than 8M data") + var XDXR_CATEGORY_MAPPING = map[int]string + func BestIP() + func CacheServers(as AllServers) error + func CommandWithConn(cli *LabClient, callback std.Factory) (std.Unmarshaler, error) + func ExamplePinger() + type AllServers struct + BestIP ServerGroup + func OpenConfig() *AllServers + type BlockInfo struct + BlockName string + BlockType uint16 + Codelist []string + StockCount uint16 + type BlockInfoPackage struct + func NewBlockInfoPackage() *BlockInfoPackage + func (obj *BlockInfoPackage) Reply() interface{} + func (obj *BlockInfoPackage) Serialize() ([]byte, error) + func (obj *BlockInfoPackage) SetParams(req *BlockInfoRequest) + func (obj *BlockInfoPackage) UnSerialize(header interface{}, data []byte) error + type BlockInfoReply struct + Block []BlockInfo + BlockNum uint16 + type BlockInfoRequest struct + BlockFile [100]byte + Size uint32 + Start uint32 + type BlockInfoResponse struct + Data []byte + Size uint32 + type BlockMeta struct + C1 byte + C2 byte + HashValue [32]byte + Size uint32 + type BlockMetaPackage struct + func NewBlockMetaPackage() *BlockMetaPackage + func (obj *BlockMetaPackage) Reply() interface{} + func (obj *BlockMetaPackage) Serialize() ([]byte, error) + func (obj *BlockMetaPackage) SetParams(req *BlockMetaRequest) + func (obj *BlockMetaPackage) UnSerialize(header interface{}, data []byte) error + type BlockMetaRequest struct + BlockFile [40]byte + type CompanyInfoCategory struct + Filename string + Length uint32 + Name string + Offset uint32 + type CompanyInfoCategoryPackage struct + func NewCompanyInfoCategoryPackage() *CompanyInfoCategoryPackage + func (obj *CompanyInfoCategoryPackage) Reply() interface{} + func (obj *CompanyInfoCategoryPackage) Serialize() ([]byte, error) + func (obj *CompanyInfoCategoryPackage) SetParams(req *CompanyInfoCategoryRequest) + func (obj *CompanyInfoCategoryPackage) UnSerialize(header interface{}, data []byte) error + type CompanyInfoCategoryReply struct + Count uint16 + Data []RawCompanyInfoCategory + type CompanyInfoCategoryRequest struct + Code [6]byte + Market uint16 + Unknown uint32 + type CompanyInfoContent struct + Code string + Content string + Length uint32 + Market proto.MarketType + Name string + func (this *CompanyInfoContent) Map(unit string) *linkedhashmap.Map + type CompanyInfoContentPackage struct + func NewCompanyInfoContentPackage() *CompanyInfoContentPackage + func (obj *CompanyInfoContentPackage) Reply() interface{} + func (obj *CompanyInfoContentPackage) Serialize() ([]byte, error) + func (obj *CompanyInfoContentPackage) SetParams(req *CompanyInfoContentRequest) + func (obj *CompanyInfoContentPackage) UnSerialize(header interface{}, data []byte) error + type CompanyInfoContentReply struct + Code string + Data []byte + Length uint16 + Market uint16 + Unknown1 []byte + type CompanyInfoContentRequest struct + Code [6]byte + Filename [80]byte + Length uint32 + Market uint16 + Offset uint32 + Unknown1 uint16 + Unknown2 uint32 + type ConnPool struct + func NewConnPool(opt Opt, size int, factory func() (interface{}, error), ...) (*ConnPool, error) + func (p *ConnPool) Close() + func (p *ConnPool) CloseAll() + func (p *ConnPool) CloseConn(conn interface{}) error + func (p *ConnPool) GetConn() interface{} + func (p *ConnPool) ReturnConn(conn interface{}) + type ExchangeState int8 + const TDX_EXCHANGE_STATE_CLOSING + const TDX_EXCHANGE_STATE_DELISTING + const TDX_EXCHANGE_STATE_NORMAL + const TDX_EXCHANGE_STATE_PAUSE + type FinanceInfo struct + BGu float64 + BaoLiu2 float64 + ChangQiFuZhai float64 + Code string + CunHuo float64 + FaQiRenFaRenGu float64 + FaRenGu float64 + GuDingZiChan float64 + GuDongRenShu float64 + GuoJiaGu float64 + HGu float64 + IPODate uint32 + Industry uint16 + JingLiRun float64 + JingYingxianJinLiu float64 + JingZiChan float64 + LiRunZongHe float64 + LiuDongFuZhai float64 + LiuDongZiChan float64 + LiuTongGuBen float64 + MeiGuJingZiChan float64 + Province uint16 + ShuiHouLiRun float64 + TouZiShouYu float64 + UpdatedDate uint32 + WeiFenLiRun float64 + WuXingZiChan float64 + YingShouZhangKuan float64 + YingyeLiRun float64 + ZhiGongGu float64 + ZhuYingLiRun float64 + ZhuYingShouRu float64 + ZiBenGongJiJin float64 + ZongGuBen float64 + ZongXianJinLiu float64 + ZongZiChan float64 + func (info FinanceInfo) IsDelisting() bool + type FinanceInfoPackage struct + func NewFinanceInfoPackage() *FinanceInfoPackage + func (obj *FinanceInfoPackage) Reply() interface{} + func (obj *FinanceInfoPackage) Serialize() ([]byte, error) + func (obj *FinanceInfoPackage) SetParams(req *FinanceInfoRequest) + func (obj *FinanceInfoPackage) UnSerialize(header interface{}, data []byte) error + type FinanceInfoReply struct + Count uint16 + First RawFinanceInfo + type FinanceInfoRequest struct + Code [6]byte + Count uint16 + Market uint8 + type HeartBeatPackage struct + func NewHeartBeat() *HeartBeatPackage + func (obj *HeartBeatPackage) Reply() interface{} + func (obj *HeartBeatPackage) Serialize() ([]byte, error) + func (obj *HeartBeatPackage) UnSerialize(header interface{}, data []byte) error + type HeartBeatReply struct + Info string + type HeartBeatRequest struct + type Hello1Package struct + func NewHello1() *Hello1Package + func (obj *Hello1Package) Reply() interface{} + func (obj *Hello1Package) Serialize() ([]byte, error) + func (obj *Hello1Package) UnSerialize(header interface{}, data []byte) error + type Hello1Reply struct + Info string + type Hello1Request struct + type Hello2Package struct + func NewHello2() *Hello2Package + func (obj *Hello2Package) Reply() interface{} + func (obj *Hello2Package) Serialize() ([]byte, error) + func (obj *Hello2Package) UnSerialize(header interface{}, data []byte) error + type Hello2Reply struct + Info string + type Hello2Request struct + type HistoryMinuteTime struct + Price float32 + Vol int + type HistoryMinuteTimePackage struct + func NewHistoryMinuteTimePackage() *HistoryMinuteTimePackage + func (obj *HistoryMinuteTimePackage) Reply() interface{} + func (obj *HistoryMinuteTimePackage) Serialize() ([]byte, error) + func (obj *HistoryMinuteTimePackage) SetParams(req *HistoryMinuteTimeRequest) + func (obj *HistoryMinuteTimePackage) UnSerialize(header interface{}, data []byte) error + type HistoryMinuteTimeReply struct + Count uint16 + List []HistoryMinuteTime + type HistoryMinuteTimeRequest struct + Code [6]byte + Date uint32 + Market uint8 + type HistoryTransactionPackage struct + func NewHistoryTransactionPackage() *HistoryTransactionPackage + func (obj *HistoryTransactionPackage) Reply() interface{} + func (obj *HistoryTransactionPackage) Serialize() ([]byte, error) + func (obj *HistoryTransactionPackage) SetParams(req *HistoryTransactionRequest) + func (obj *HistoryTransactionPackage) UnSerialize(header interface{}, data []byte) error + type HistoryTransactionRequest struct + Code [6]byte + Count uint16 + Date uint32 + Market uint16 + Start uint16 + type IndexBarsPackage struct + func NewIndexBarsPackage() *IndexBarsPackage + func (obj *IndexBarsPackage) Reply() interface{} + func (obj *IndexBarsPackage) Serialize() ([]byte, error) + func (obj *IndexBarsPackage) SetParams(req *SecurityBarsRequest) + func (obj *IndexBarsPackage) UnSerialize(header interface{}, data []byte) error + type LabClient struct + MaxRetryTimes int + RetryDuration time.Duration + Timeout time.Duration + func NewClientForTest(addr string) (*LabClient, error) + func (cli *LabClient) Close() error + func (cli *LabClient) Do(request std.Marshaler, response std.Unmarshaler) error + type Level struct + Price float64 + Vol int + type Message interface + Reply func() interface{} + Serialize func() ([]byte, error) + UnSerialize func(head interface{}, in []byte) error + type MinuteTime struct + Price float32 + Vol int + type MinuteTimePackage struct + func NewMinuteTimePackage() *MinuteTimePackage + func (obj *MinuteTimePackage) Reply() interface{} + func (obj *MinuteTimePackage) Serialize() ([]byte, error) + func (obj *MinuteTimePackage) SetParams(req *MinuteTimeRequest) + func (obj *MinuteTimePackage) UnSerialize(header interface{}, data []byte) error + type MinuteTimeReply struct + Count uint16 + List []MinuteTime + type MinuteTimeRequest struct + Code [6]byte + Date uint32 + Market uint16 + type Opt struct + ConnectionTimeout time.Duration + MaxRetryTimes int + ReadTimeout time.Duration + RetryDuration time.Duration + Servers []Server + WriteTimeout time.Duration + type RawCompanyInfoCategory struct + Filename []byte + Length uint32 + Name []byte + Offset uint32 + type RawFinanceInfo struct + BGu float32 + BaoLiu1 float32 + BaoLiu2 float32 + ChangQiFuZhai float32 + Code [6]byte + CunHuo float32 + FaQiRenFaRenGu float32 + FaRenGu float32 + GuDingZiChan float32 + GuDongRenShu float32 + GuoJiaGu float32 + HGu float32 + IPODate uint32 + Industry uint16 + JingLiRun float32 + JingYingxianJinLiu float32 + JingZiChan float32 + LiRunZongHe float32 + LiuDongFuZhai float32 + LiuDongZiChan float32 + LiuTongGuBen float32 + Market uint8 + Province uint16 + ShuiHouLiRun float32 + TouZiShouYu float32 + UpdatedDate uint32 + WeiFenLiRun float32 + WuXingZiChan float32 + Yingshouzhangkuan float32 + YingyeLiRun float32 + ZhiGongGu float32 + ZhuYingLiRun float32 + ZhuYingShouRu float32 + ZiBenGongJiJin float32 + ZongGuBen float32 + ZongXianJinLiu float32 + ZongZiChan float32 + type RawFinanceInfo1 struct + BGu float32 + BaoLiu1 float32 + BaoLiu2 float32 + BaoLiu3 [7]byte + ChangQiFuZhai float32 + CunHuo float32 + FaQiRenFaRenGu float32 + FaRenGu float32 + GuDingZiChan float32 + GuDongRenShu float32 + GuoJiaGu float32 + HGu float32 + IPODate uint32 + Industry uint16 + JingLiRun float32 + JingYingxianJinLiu float32 + JingZiChan float32 + LiRunZongHe float32 + LiuDongFuZhai float32 + LiuDongZiChan float32 + LiuTongGuBen float32 + Province uint16 + ShuiHouLiRun float32 + TouZiShouYu float32 + UpdatedDate uint32 + WeiFenLiRun float32 + WuXingZiChan float32 + Yingshouzhangkuan float32 + YingyeLiRun float32 + ZhiGongGu float32 + ZhuYingLiRun float32 + ZhuYingShouRu float32 + ZiBenGongJiJin float32 + ZongGuBen float32 + ZongXianJinLiu float32 + ZongZiChan float32 + type RawXdxrInfo struct + Category int + Code string + Data []byte + Date uint32 + Market int + Unknown int + type Security struct + Code string + DecimalPoint int8 + Name string + PreClose float64 + Reversed1 [4]byte + Reversed2 [4]byte + VolUnit uint16 + type SecurityBar struct + Amount float64 + Close float64 + DateTime string + Day int + DownCount uint16 + High float64 + Hour int + Low float64 + Minute int + Month int + Open float64 + UpCount uint16 + Vol float64 + Year int + type SecurityBarsPackage struct + func NewSecurityBarsPackage() *SecurityBarsPackage + func (obj *SecurityBarsPackage) Reply() interface{} + func (obj *SecurityBarsPackage) Serialize() ([]byte, error) + func (obj *SecurityBarsPackage) SetParams(req *SecurityBarsRequest) + func (obj *SecurityBarsPackage) UnSerialize(header interface{}, data []byte) error + type SecurityBarsReply struct + Count uint16 + List []SecurityBar + type SecurityBarsRequest struct + Category uint16 + Code [6]byte + Count uint16 + I uint16 + Market uint16 + Start uint16 + type SecurityCountPackage struct + func NewSecurityCountPackage() *SecurityCountPackage + func (obj *SecurityCountPackage) Reply() interface{} + func (obj *SecurityCountPackage) Serialize() ([]byte, error) + func (obj *SecurityCountPackage) SetParams(req *SecurityCountRequest) + func (obj *SecurityCountPackage) UnSerialize(header interface{}, data []byte) error + type SecurityCountReply struct + Count uint16 + type SecurityCountRequest struct + Market uint16 + type SecurityListPackage struct + func NewSecurityListPackage() *SecurityListPackage + func (obj *SecurityListPackage) Reply() interface{} + func (obj *SecurityListPackage) Serialize() ([]byte, error) + func (obj *SecurityListPackage) SetParams(req *SecurityListRequest) + func (obj *SecurityListPackage) UnSerialize(header interface{}, data []byte) error + type SecurityListReply struct + Count uint16 + List []Security + type SecurityListRequest struct + Market uint16 + Start uint16 + type SecurityQuote struct + Active1 uint16 + Active2 uint16 + Amount float64 + Ask1 float64 + Ask2 float64 + Ask3 float64 + Ask4 float64 + Ask5 float64 + AskVol1 int + AskVol2 int + AskVol3 int + AskVol4 int + AskVol5 int + BVol int + Bid1 float64 + Bid2 float64 + Bid3 float64 + Bid4 float64 + Bid5 float64 + BidVol1 int + BidVol2 int + BidVol3 int + BidVol4 int + BidVol5 int + CloseVolume int + Code string + CurVol int + High float64 + IndexDown int + IndexDownLimit int + IndexOpenAmount int + IndexUp int + IndexUpLimit int + LastClose float64 + Low float64 + Market uint8 + Open float64 + OpenVolume int + Price float64 + Rate float64 + ReversedBytes0 int + ReversedBytes1 int + ReversedBytes4 uint16 + ReversedBytes5 int + ReversedBytes6 int + ReversedBytes7 int + ReversedBytes8 int + SVol int + ServerTime string + State TradeState + StockOpenAmount int + Vol int + type SecurityQuotesPackage struct + func NewSecurityQuotesPackage() *SecurityQuotesPackage + func (obj *SecurityQuotesPackage) Reply() interface{} + func (obj *SecurityQuotesPackage) Serialize() ([]byte, error) + func (obj *SecurityQuotesPackage) SetParams(req *SecurityQuotesRequest) + func (obj *SecurityQuotesPackage) UnSerialize(header interface{}, data []byte) error + type SecurityQuotesReply struct + Count uint16 + List []SecurityQuote + type SecurityQuotesRequest struct + Count uint16 + StockList []Stock + type Server struct + CrossTime int64 + Host string + Name string + Port int + func GetFastHost(key string) []Server + func (s Server) Addr() string + type ServerGroup struct + EX []Server + GP []Server + HQ []Server + type Snapshot struct + Active uint16 + Active2 uint16 + Amount float64 + Ask1 float64 + Ask2 float64 + Ask3 float64 + Ask4 float64 + Ask5 float64 + AskVol1 int + AskVol2 int + AskVol3 int + AskVol4 int + AskVol5 int + BVol int + Bid1 float64 + Bid2 float64 + Bid3 float64 + Bid4 float64 + Bid5 float64 + BidVol1 int + BidVol2 int + BidVol3 int + BidVol4 int + BidVol5 int + CloseVolume int + Code string + CurVol int + Date string + ExchangeState ExchangeState + High float64 + IndexDown int + IndexDownLimit int + IndexOpenAmount int + IndexUp int + IndexUpLimit int + LastClose float64 + Low float64 + Market uint8 + Open float64 + OpenVolume int + Price float64 + Rate float64 + ReversedBytes0 int + ReversedBytes1 int + ReversedBytes4 uint16 + ReversedBytes5 int + ReversedBytes6 int + ReversedBytes7 int + ReversedBytes8 int + SVol int + SecurityCode string + ServerTime string + State TradeState + StockOpenAmount int + Vol int + func (this *Snapshot) CheckDirection() (biddingDirection, volumeDirection int) + type StdApi struct + func NewStdApi() (*StdApi, error) + func NewStdApiWithServers(srvs []Server) (*StdApi, error) + func (this *StdApi) Close() + func (this *StdApi) GetBlockInfo(blockFile string) (*BlockInfoResponse, error) + func (this *StdApi) GetBlockMeta(blockFile string) (*BlockMeta, error) + func (this *StdApi) GetCompanyInfoCategory(code string) ([]CompanyInfoCategory, error) + func (this *StdApi) GetCompanyInfoContent(code string, name string) (*CompanyInfoContent, error) + func (this *StdApi) GetFinanceInfo(code string) (*FinanceInfo, error) + func (this *StdApi) GetHistoryMinuteTimeData(code string, date uint32) (*HistoryMinuteTimeReply, error) + func (this *StdApi) GetHistoryTransactionData(code string, date uint32, start uint16, count uint16) (*TransactionReply, error) + func (this *StdApi) GetIndexBars(code string, category uint16, start uint16, count uint16) (*SecurityBarsReply, error) + func (this *StdApi) GetKLine(code string, category uint16, start uint16, count uint16) (*SecurityBarsReply, error) + func (this *StdApi) GetMinuteTimeData(code string) (*MinuteTimeReply, error) + func (this *StdApi) GetSecurityCount(market proto.MarketType) (*SecurityCountReply, error) + func (this *StdApi) GetSecurityList(market proto.MarketType, start uint16) (*SecurityListReply, error) + func (this *StdApi) GetSecurityQuotes(markets []proto.MarketType, symbols []string) (*SecurityQuotesReply, error) + func (this *StdApi) GetSnapshot(codes []string) (list []Snapshot, err error) + func (this *StdApi) GetTransactionData(code string, start uint16, count uint16) (*TransactionReply, error) + func (this *StdApi) GetXdxrInfo(code string) ([]XdxrInfo, error) + func (this *StdApi) HeartBeat() (*HeartBeatReply, error) + func (this *StdApi) Hello1() (*Hello1Reply, error) + func (this *StdApi) Hello2() (*Hello2Reply, error) + func (this *StdApi) V2GetSecurityQuotes(markets []proto.MarketType, symbols []string) (*V2SecurityQuotesReply, error) + type StdRequestHeader struct + Method uint16 + PacketType uint8 + PkgLen1 uint16 + PkgLen2 uint16 + SeqID uint32 + ZipFlag uint8 + type StdResponseHeader struct + I1 uint32 + I3 uint8 + Method uint16 + SeqID uint32 + UnZipSize uint16 + ZipFlag uint8 + ZipSize uint16 + type Stock struct + Code string + Market uint8 + type TcpClient struct + Addr string + func NewClient(opt *Opt) *TcpClient + func (client *TcpClient) Close() error + func (client *TcpClient) Command(msg Message) error + func (client *TcpClient) Connect() error + type TdxMarket int + type TickTransaction struct + BuyOrSell int + Num int + Price float64 + Time string + Vol int + type TradeState int8 + const TDX_SECURITY_TRADE_STATE_DELISTING + const TDX_SECURITY_TRADE_STATE_NORMAL + const TDX_SECURITY_TRADE_STATE_SUSPEND + type TradeType = int32 + const TDX_TICK_BUY + const TDX_TICK_NEUTRAL + const TDX_TICK_SELL + const TDX_TICK_UNKNOWN + type TransactionPackage struct + func NewTransactionPackage() *TransactionPackage + func (obj *TransactionPackage) Reply() interface{} + func (obj *TransactionPackage) Serialize() ([]byte, error) + func (obj *TransactionPackage) SetParams(req *TransactionRequest) + func (obj *TransactionPackage) UnSerialize(header interface{}, data []byte) error + type TransactionReply struct + Count uint16 + List []TickTransaction + type TransactionRequest struct + Code [6]byte + Count uint16 + Market uint16 + Start uint16 + type V2Level struct + Price float64 + Vol int + type V2SecurityQuote struct + Active1 uint16 + Active2 uint16 + Amount float64 + Ask1 float64 + AskVol1 int + BVol int + Bid1 float64 + BidVol1 int + Code string + CurVol int + High float64 + LastClose float64 + Low float64 + Market uint8 + Open float64 + Price float64 + Rate float64 + ReversedBytes0 int + ReversedBytes1 int + ReversedBytes2 int + ReversedBytes3 int + ReversedBytes4 uint16 + ReversedBytes5 int + ReversedBytes6 int + ReversedBytes7 int + ReversedBytes8 int + SVol int + ServerTime string + Vol int + type V2SecurityQuotesPackage struct + func NewV2SecurityQuotesPackage() *V2SecurityQuotesPackage + func (obj *V2SecurityQuotesPackage) Reply() interface{} + func (obj *V2SecurityQuotesPackage) Serialize() ([]byte, error) + func (obj *V2SecurityQuotesPackage) SetParams(req *V2SecurityQuotesRequest) + func (obj *V2SecurityQuotesPackage) UnSerialize(header interface{}, data []byte) error + type V2SecurityQuotesReply struct + Count uint16 + List []V2SecurityQuote + type V2SecurityQuotesRequest struct + Count uint16 + StockList []V2Stock + type V2Stock struct + Code string + Market uint8 + type XdxrInfo struct + Category int + Date string + FenHong float64 + FenShu float64 + HouLiuTong float64 + HouZongGuBen float64 + Name string + PeiGu float64 + PeiGuJia float64 + QianLiuTong float64 + QianZongGuBen float64 + SongZhuanGu float64 + SuoGu float64 + XingGuanJia float64 + func (x *XdxrInfo) Adjust() func(p float64) float64 + type XdxrInfoPackage struct + func NewXdxrInfoPackage() *XdxrInfoPackage + func (obj *XdxrInfoPackage) Reply() interface{} + func (obj *XdxrInfoPackage) Serialize() ([]byte, error) + func (obj *XdxrInfoPackage) SetParams(req *XdxrInfoRequest) + func (obj *XdxrInfoPackage) UnSerialize(header interface{}, data []byte) error + type XdxrInfoReply struct + Count uint16 + List []RawXdxrInfo + Unknown []byte + type XdxrInfoRequest struct + Code [6]byte + Market uint8 Other modules containing this package gitee.com/quant1x/tdx/v2