statusmonitor

package
v0.0.0-...-358f329 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StatusHandler

func StatusHandler(rw http.ResponseWriter, r *http.Request)

StatusHandler synchronously establishes external connections to determine the health of the network. If all attempts fail it will return a 500 status.

Types

type Failure

type Failure int
const (
	NoFailure           Failure = 0
	ConnectivityFailure Failure = 1
	MonitoringFailure   Failure = 2
)

func (*Failure) String

func (f *Failure) String() string

type JsonResponse

type JsonResponse map[string]interface{}

JsonResponse represents a generic json object

func (JsonResponse) String

func (r JsonResponse) String() (s string)

Json Marshaling

type StatusMonitor

type StatusMonitor struct {
	ptomb.Tomb
	IsHealthy   bool
	LastChanged time.Time
	AZName      string
	FailureType Failure
	// contains filtered or unexported fields
}

StatusMonitor represents the AZ Health Status for this API instance

func NewStatusMonitor

func NewStatusMonitor() *StatusMonitor

newStatusMonitor returns a new StatusMonitor object and kicks off the AZ monitoring goroutine

func (*StatusMonitor) AzStatusChecker

func (s *StatusMonitor) AzStatusChecker() (map[string]string, error)

AzStatusChecker checks the status of the default status monitor

func (*StatusMonitor) Handler

func (s *StatusMonitor) Handler(rw http.ResponseWriter, r *http.Request)

Handler returns the AZ health as reported by the StatusMonitor

Jump to

Keyboard shortcuts

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