update mod,readme file

This commit is contained in:
bense
2023-01-31 08:49:16 +08:00
parent 13073cd8e4
commit 5d86baf170
9 changed files with 44 additions and 12 deletions

31
examples/main.go Normal file
View File

@@ -0,0 +1,31 @@
package main
import (
"github.com/bensema/gotdx"
"log"
)
func main() {
var opt = &gotdx.Opt{
Host: "119.147.212.81",
Port: 7709,
}
api := gotdx.NewClient(opt)
connectReply, err := api.Connect()
if err != nil {
log.Println(err)
}
log.Println(connectReply.Info)
reply, err := api.GetSecurityQuotes([]uint8{gotdx.MarketSh, gotdx.MarketSz}, []string{"000001", "600008"})
if err != nil {
log.Println(err)
}
for _, obj := range reply.List {
log.Printf("%+v", obj)
}
_ = api.Disconnect()
}