ginslack

package module
v0.0.0-...-edafc3c Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: MIT Imports: 7 Imported by: 0

README

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()
}


Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Recovery

func Recovery(s *slack.Slack) gin.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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