6 Star 23 Fork 31

王布衣/gotdx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
tdx-client.go 481 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2023-06-17 14:31 . 添加一个简易的客户端调用
package gotdx
import (
"gitee.com/quant1x/gotdx/quotes"
"sync"
)
var (
stdApi *quotes.StdApi = nil
tdxMutex sync.Mutex
)
func initTdxApi() {
if stdApi == nil {
api_, err := quotes.NewStdApi()
if err != nil {
return
}
stdApi = api_
}
}
func GetTdxApi() *quotes.StdApi {
tdxMutex.Lock()
defer tdxMutex.Unlock()
initTdxApi()
return stdApi
}
func ReOpen() {
tdxMutex.Lock()
defer tdxMutex.Unlock()
if stdApi != nil {
stdApi.Close()
stdApi = nil
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/quant1x/gotdx.git
git@gitee.com:quant1x/gotdx.git
quant1x
gotdx
gotdx
v1.10.1

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385