Yet Another Groonga Client for Go.
$ go get github.com/hhatto/goroo
- Start Groonga Server (with HTTP)
$ groonga -s -l 8 --log-path ./grn.log --protocol http grn.db
- execute client code
package main
import (
"fmt"
"github.com/hhatto/goroo"
)
func main() {
client := goroo.NewClient("http", "localhost", 10041)
result, err := client.Call("select", map[string]string{"table": "Users"})
if err != nil {
fmt.Println("Call() error:", err)
return
}
fmt.Println(result)
}
- Start Groonga Server (with GQTP)
$ groonga -s -l 8 --log-path ./grn.log --protocol gqtp grn.db
- execute client code
package main
import (
"fmt"
"github.com/hhatto/goroo"
)
func main() {
client := goroo.NewClient("gqtp", "localhost", 10043)
result, err := client.Call("select", map[string]string{"table": "Users"})
if err != nil {
fmt.Println("Call() error:", err)
return
}
fmt.Println(result)
}
MIT