heartbeat

package module
v0.0.0-...-9091adc Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2016 License: MIT Imports: 5 Imported by: 0

README

Heartbeat Heartbeat Build Status

Heartbeat is a small module to use with a Goa app providing a heartbeat to ping for health check purposes.

By adding Heartbeat your app will respond with a 200 OK and a JSON object like so: {"ENV":"production"} on the url you specify or /health if no url is specified. Heartbeat returns a simple JSON object with one key, ENV, having the value of the ENV environment variable or "dev" if ENV has no value.

Heartbeat is not a middleware, instead it adds itself to service.Mux as an http handler.

Usage

import (
  "github.com/goadesign/goa"
  "github.com/richardbolt/heartbeat"
)

service := goa.New("API")
heartbeat.Heartbeat(service, "/health")

service.ListenAndServe(":8080")

The usage signature of Heartbeat is:

Heartbeat(*goa.Service, string)

Documentation

Overview

Package heartbeat is a small module to use with a Goa app providing a heartbeat to ping for health check purposes.

By adding Heartbeat your app will respond with a 200 OK and a JSON object like so: `{"ENV":"production"}` on the url you specify or /health if no url is specified. Heartbeat returns a simple JSON object with one key, ENV, having the value of the ENV environment variable or "dev" if ENV has no value.

Heartbeat is not a middleware, instead it adds itself to service.Mux as an http handler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Heartbeat

func Heartbeat(service *goa.Service, url string)

Heartbeat adds a standard response on a given url, which defaults to /health if url is an empty string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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