mirror of
https://github.com/injoyai/tdx.git
synced 2025-11-26 21:25:35 +08:00
优化文档
This commit is contained in:
34
README.md
34
README.md
@@ -28,29 +28,25 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/injoyai/tdx"
|
"github.com/injoyai/tdx"
|
||||||
"github.com/injoyai/tdx/protocol"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
//连接服务器,开启日志,开启断连重试
|
//连接服务器,开启日志,开启断连重试
|
||||||
c, err := tdx.Dial("124.71.187.122:7709", tdx.WithDebug(true), tdx.WithRedial(true))
|
c, err := tdx.Dial("124.71.187.122:7709", tdx.WithDebug(), tdx.WithRedial())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
resp, err := c.GetStockQuotes(map[protocol.Exchange]string{
|
resp, err := c.GetQuote("sz000001", "sh600008")
|
||||||
protocol.ExchangeSZ: "000001",
|
if err != nil {
|
||||||
protocol.ExchangeSH: "600008",
|
panic(err)
|
||||||
})
|
}
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, v := range resp {
|
for _, v := range resp {
|
||||||
fmt.Printf("%#v\n", v)
|
fmt.Printf("%#v\n", v)
|
||||||
}
|
}
|
||||||
<-c.Done()
|
<-c.Done()
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user