Yet Another Groonga Client for Go
Go Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
.gitignore
.travis.yml
Makefile
README.md
THANKS
goroo.go
goroo_test.go
gqtp_client.go
gqtp_client_test.go
gqtp_server_mock_test.go
http_client.go
http_client_test.go

README.md

goroo (ごろう) Build Status

Yet Another Groonga Client for Go.

Installation

$ go get github.com/hhatto/goroo

Usage

with HTTP

  1. Start Groonga Server (with HTTP)

    ex)

    $ groonga -s -l 8 --log-path ./grn.log --protocol http grn.db
    
  2. 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)
    }

with GQTP

  1. Start Groonga Server (with GQTP)

    ex)

    $ groonga -s -l 8 --log-path ./grn.log --protocol gqtp grn.db
    
  2. 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)
    }

License

MIT