didasy / healthcheck

Healthcheck helper for Gin + Consul

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Healthcheck

Build Status codecov GoDoc Go Report Card FOSSA Status

Healthcheck helper for Gin to be able to easily got health checked thoroughly by Consul

Usage

Download and install it:

go get github.com/JesusIslam/healthcheck

Import it in your code:

import "github.com/JesusIslam/healthcheck

Simplest default example:

package main

import (
    "time"

    "github.com/JesusIslam/healthcheck"
    "github.com/gin-gonic/gin"
)

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

    timeout := 15 * time.Second
    h := healthcheck.New(nil, "myauthtoken", timeout)
    r.GET("/health", h.Handle)

    r.Run(":8080")
}

About

Healthcheck helper for Gin + Consul

License:MIT License


Languages

Language:Go 100.0%