https://github.com/jerakia/go-jerakia
A Go client library for Jerakia
https://github.com/jerakia/go-jerakia
Last synced: 4 months ago
JSON representation
A Go client library for Jerakia
- Host: GitHub
- URL: https://github.com/jerakia/go-jerakia
- Owner: jerakia
- License: apache-2.0
- Created: 2018-02-11T05:45:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-13T15:14:34.000Z (about 5 years ago)
- Last Synced: 2025-04-25T05:36:31.887Z (about 1 year ago)
- Language: Go
- Size: 74.2 KB
- Stars: 1
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-jerakia
==========
A Go client library for [Jerakia](http://jerakia.io).
Quickstart
----------
```go
package main
import (
"fmt"
"net/http"
"github.com/jerakia/go-jerakia"
)
func main() {
config := jerakia.ClientConfig{
URL: "http://localhost:9992/v1",
Token: "mytok:abcd",
}
client := jerakia.NewClient(http.DefaultClient, config)
lookupOpts := jerakia.LookupOpts{
Namespace: "test",
Metadata: map[string]string{
"hostname": "example",
},
}
result, err := jerakia.Lookup(&client, "users", &lookupOpts)
if err != nil {
panic(err)
}
fmt.Printf("%#v\n", result)
}
```
Development
-----------
### Installation
```shell
$ go get github.com/jerakia/go-jerakia
```
### Unit Tests
```shell
$ cd $GOPATH/github.com/jerakia/go-jerakia
$ make test
```
### Acceptance Tests
Make sure you have the following environment variables set:
* `JERAKIA_URL`
* `JERAKIA_TOKEN`
```shell
$ cd $GOPATH/github.com/jerakia/go-jerakia
$ make testacc
```
> You can use the supplied `acceptance/deploy.sh` script to install
> all requirements (including Jerakia and Go) on an Ubuntu 16.04 system.
>
> The script will create a `~/jrc` file with all required environment
> variables set.
### Vendor Dependencies
`go-jerakia` uses [Go modules](https://github.com/golang/go/wiki/Modules) for dependency/vendor management.