Coder Social home page Coder Social logo

keisatsu's Introduction

Keisatsu

"Keisatsu desu"

Keisatsu (警察) is a simple monitoring Go package which can help to notify you by sending a webhook to the registered URL whenever there is a panic in your Go application or when you told it to send you a notification.

Getting Started

Installing

This assumes you already have a working Go environment, if not please see this page first.

go get will always pull the latest tagged release from the master branch.

go get github.com/hansenedrickh/keisatsu

Usage

First, you need to initialize the Keisatsu by providing it the necessary information

k := keisatsu.New(appName, webhookURL, secretToken)

Then, you can put this script to handle a panic situation wherever you want

defer k.WatchPanic()

Or if you want to handle expected error, then you can use this script

k.Error(message)

It will send a POST http request to the given webhook url, with this json as a body

{
  "app_name": <your_app_name>,
  "level": <error_level>,  
  "message": <error_message>,
  "stack_trace": <stack_trace>
}

The secret token will be put in the X-Secret-Token header which you can use for validating the request coming from Keisatsu.

Credit

Made with ❤️ by Hansen Edrick Harianto

keisatsu's People

Contributors

hansenedrickh avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.