Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hhatto/goroo
Yet Another Groonga Client for Go
https://github.com/hhatto/goroo
Last synced: about 1 month ago
JSON representation
Yet Another Groonga Client for Go
- Host: GitHub
- URL: https://github.com/hhatto/goroo
- Owner: hhatto
- Created: 2014-09-18T07:59:29.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-06-26T15:10:56.000Z (over 4 years ago)
- Last Synced: 2024-05-09T21:57:07.057Z (6 months ago)
- Language: Go
- Homepage:
- Size: 44.9 KB
- Stars: 12
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# goroo (ごろう) [![Build Status](https://travis-ci.org/hhatto/goroo.png?branch=master)](https://travis-ci.org/hhatto/goroo)
Yet Another Groonga Client for Go.
## Installation
```
$ go get github.com/hhatto/goroo
```## Usage
### with HTTP
1. Start Groonga Server (with HTTP)```
$ groonga -s -l 8 --log-path ./grn.log --protocol http grn.db
```2. execute client code
```go
package mainimport (
"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)```
$ groonga -s -l 8 --log-path ./grn.log --protocol gqtp grn.db
```2. execute client code
```go
package mainimport (
"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