https://github.com/cjgdev/gorymartini
Riemann middleware for martini framework
https://github.com/cjgdev/gorymartini
Last synced: 5 months ago
JSON representation
Riemann middleware for martini framework
- Host: GitHub
- URL: https://github.com/cjgdev/gorymartini
- Owner: cjgdev
- License: mit
- Created: 2014-07-01T11:28:29.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-07-01T13:01:38.000Z (almost 12 years ago)
- Last Synced: 2024-06-21T14:03:29.074Z (about 2 years ago)
- Language: Go
- Size: 129 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GoryMartini
[Riemann](https://github.com/aphyr/riemann) middleware for martini framework.
Logs the following information:
* The time the request took
* The http status code
* The requested path
## Installation
To install the package for use in your own programs:
```
go get github.com/bigdatadev/goryman
go get github.com/bigdatadev/gorymartini
```
## Getting Started
First we'll need to import the library:
```go
import (
"github.com/bigdatadev/goryman"
"github.com/bigdatadev/gorymartini"
"github.com/go-martini/martini"
)
```
Next we'll need to create the client and martini handler:
```go
c, h := gorymartini.NewGoryMartini("localhost:5555")
err := c.Connect()
if c == nil || h == nil {
panic(err)
}
```
Don't forget to close the client connection when you're done:
```go
defer c.Close()
```
Now we simply need to use the handler:
```go
m := martini.New()
// ...
m.Use(h)
m.Run()
```
## Contributing
Just send me a pull request. Please take a look at the project issues and see how you can help. Here are some tips:
- please add more tests.
- please check your syntax.
## Author
Christopher Gilbert
* Web: [http://cjgilbert.me](http://cjgilbert.me)
* Twitter: [@bigdatadev](https://twitter.com/bigdatadev)
* Linkedin: [/in/christophergilbert](https://www.linkedin.com/in/christophergilbert)
## Copyright
See [LICENSE](LICENSE) document