Documentation
¶
Index ¶
Constants ¶
const CheckPath = "/soh"
CheckPath is the baked in SOH endpoint path.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
Check calls the given service endpoint with a given context and timeout. An error will be returned if the connection fails, or the response status is not 200 (i.e. StatusOK). A successful check will return only the check message reply.
func CheckStatus ¶
CheckStatus runs a Check on the given service and returns zero for a healthy service, and one otherwise.
@param {string} servicePat: service address and path to check e.g. 8080/soh
func RunningHealthCheck ¶
func RunningHealthCheck() bool
RunningHealthCheck returns whether the -check flag was used when starting the program. This flag indicates that the program is being used to run a health check on another program.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides a mechanism to update a service SOH status.
func (*Service) Alive ¶
Alive allows an application to perform a complex task while still sending hearbeats.
func (*Service) Fail ¶
func (s *Service) Fail()
Fail updates the Service to indicate the service is not running as expected.
func (*Service) Ok ¶
func (s *Service) Ok()
Ok updates the Service to indicate the service is running as expected.