gorymartini

package module
v0.0.0-...-6a1c553 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2014 License: MIT Imports: 7 Imported by: 0

README

GoryMartini

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:

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:

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:

defer c.Close()

Now we simply need to use the handler:

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

See LICENSE document

Documentation

Overview

Riemann middleware for martini framework

Copyright (C) 2014 by Christopher Gilbert <christopher.john.gilbert@gmail.com>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGoryMartini

func NewGoryMartini(host string) (*goryman.GorymanClient, martini.Handler)

NewGoryMartini - Factory

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL