From 2823ad1b5ea52128903dbf4d5238325684c54329 Mon Sep 17 00:00:00 2001 From: Paul Lhussiez Date: Wed, 30 Aug 2017 10:52:59 +0200 Subject: [PATCH] Quick first documentation --- README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 222a99a..9a3b247 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,33 @@ # go-gin-prometheus -=== +[![](https://godoc.org/github.com/zsais/go-gin-prometheus?status.svg)](https://godoc.org/github.com/zsais/go-gin-prometheus) Gin Web Framework Prometheus metrics exporter + +## Installation + +`$ go get github.com/zsais/go-gin-prometheus` + +## Usage + +```go +package main + +import ( + "github.com/gin-gonic/gin" + "github.com/zsais/go-gin-prometheus" +) + +func main() { + r := gin.New() + + p := ginprometheus.NewPrometheus("gin") + p.Use(r) + + r.GET("/", func(c *gin.Context) { + c.JSON(200, "Hello world!") + }) + + r.Run(":29090") +} +``` + +See the [example.go file](https://github.com/zsais/go-gin-prometheus/blob/master/example/example.go) \ No newline at end of file