Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amir/raidman
Go Riemann client
https://github.com/amir/raidman
go riemann-client
Last synced: 4 days ago
JSON representation
Go Riemann client
- Host: GitHub
- URL: https://github.com/amir/raidman
- Owner: amir
- License: unlicense
- Created: 2013-02-05T20:18:21.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-04-15T20:35:54.000Z (over 7 years ago)
- Last Synced: 2024-12-29T18:11:45.952Z (11 days ago)
- Topics: go, riemann-client
- Language: Go
- Size: 33.2 KB
- Stars: 67
- Watchers: 4
- Forks: 25
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Raidman
=======Go Riemann client
```go
package mainimport (
"github.com/amir/raidman"
)func main() {
c, err := raidman.Dial("tcp", "localhost:5555")
if err != nil {
panic(err)
}var event = &raidman.Event{
State: "success",
Host: "raidman",
Service: "raidman-sample",
Metric: 100,
Ttl: 10,
}// send one event
err = c.Send(event)
if err != nil {
panic(err)
}
// send multiple events at once
err = c.SendMulti([]*raidman.Event{
&raidman.Event{
State: "success",
Host: "raidman",
Service: "raidman-sample",
Metric: 100,
Ttl: 10,
},
&raidman.Event{
State: "failure",
Host: "raidman",
Service: "raidman-sample",
Metric: 100,
Ttl: 10,
},
&raidman.Event{
State: "success",
Host: "raidman",
Service: "raidman-sample",
Metric: 100,
Ttl: 10,
},
})
if err != nil {
panic(err)
}events, err := c.Query("host = \"raidman\"")
if err != nil {
panic(err)
}if len(events) < 1 {
panic("Submitted event not found")
}c.Close()
}```