steward

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2016 License: MIT Imports: 2 Imported by: 2

README

Steward

Build Status Coverage Go Reportcard GoDoc

Steward adds a drop in status endpoint with minimal effort for service health checks.

Usage

To use steward, link this package into your program:

import _ "github.com/gomicro/steward"

If your application is not already running an http server, you need to start one. Add "net/http" to your imports and the following code to your main function:

go http.ListenAndServe("localhost:8080", nil)

Examples

  1. Example1 - Serve endpoint localhost:8000/status only returning status code
  2. Example2 - Serve endpoint localhost:8000/status with custom JSON payload

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleStatus

func HandleStatus(w http.ResponseWriter, req *http.Request)

HandleStatus implements the go http handler interface to display specified status details

func SetStatusEndpoint

func SetStatusEndpoint(e string)

SetStatusEndpoint overrides the default endpoint with desired value

func SetStatusResponse

func SetStatusResponse(v interface{})

SetStatusResponse overrides the default response payload for the status endpoint

Types

This section is empty.

Directories

Path Synopsis
ext

Jump to

Keyboard shortcuts

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