steward

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2016 License: MIT Imports: 2 Imported by: 2

README

Steward

Build Status 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)

func SetStatusEndpoint

func SetStatusEndpoint(e string)

func SetStatusResponse

func SetStatusResponse(v interface{})

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