README
¶
中软杯算法接入GoDriver
install
go get gitee.com/allo123/chinasoftbeigodriver
usage
import (
driver "gitee.com/allo123/chinasoftbeigodriver"
)
// get database list
dbList, err := driver.GetDBList()
if err != nil {
// error handling
}
// send result back
driver.SendData(result)
// get Args
driver.Args
example
Hello World Demo
package main
import (
driver "gitee.com/allo123/chinasoftbeigodriver"
)
func main() {
dbList, err := driver.GetDBList()
if err != nil {
os.Exit(-1)
}
if len(dbList) != 0 {
driver.SendData([]byte(dbList[0].DBAddr+"\n"))
}
driver.SendData([]byte("Hello World."))
}
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type DBInfo ¶
type DBInfo struct { Type DBName `json:"type"` Addr string `json:"addr"` Database string `json:"database"` UserName string `json:"username"` Password string `json:"password"` }
DBInfo database info
Click to show internal directories.
Click to hide internal directories.