easonlin404 / gin-slack

Reporting panic to Slack for Gin middleware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gin-slack

Gin framework middleware for reporting panic to Slack.

Travis branch Codecov branch Go Report Card GoDoc Slack Image

Features

  • todo

Installation

$ go get -u github.com/easonlin404/gin-slack/

Usage

package main

import (
	"github.com/easonlin404/gin-slack"
	"github.com/easonlin404/go-slack"
	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.New()

	// You need get your slack WebhookURL from https://api.slack.com/incoming-webhooks
	s := slack.New().WebhookURL("https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX")

	// Use ginslack middleware
	r.Use(ginslack.Recovery(s))

	// Other your handler	
	// r.Get("get",....)
	
	r.Run()
}

About

Reporting panic to Slack for Gin middleware

License:MIT License


Languages

Language:Go 100.0%