negronigorelic

package module
v0.0.0-...-0547cdd Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2014 License: MIT Imports: 4 Imported by: 0

README

negroni-gorelic

New Relic middleware for the negroni framework.

Usage

package main

import (
	"fmt"
	"net/http"

	"github.com/codegangsta/negroni"
	"github.com/jingweno/negroni-gorelic"
)

func main() {
	r := http.NewServeMux()
	r.HandleFunc(`/`, func(w http.ResponseWriter, r *http.Request) {
		w.WriteHeader(http.StatusOK)
		fmt.Fprintf(w, "success!\n")
	})

	n := negroni.New()
	n.Use(negronigorelic.New("NEW_RELIC_LICENSE_KEY", "example-app", true))
	n.UseHandler(r)

	n.Run(":3000")
}

See a running example.

Credits

A shout out to @yvasiyarov for his awesome work of gorelic.

License

negroni-gorelic is released under the MIT license. See LICENSE.md.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gorelic

type Gorelic struct {
	Agent *gorelic.Agent
}

func New

func New(license string, appname string, verbose bool) *Gorelic

func (*Gorelic) ServeHTTP

func (g *Gorelic) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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