checkgrp

package
v0.0.0-...-c2300e3 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package checkgrp maintains the group of handlers for health checking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handlers

type Handlers struct {
	// contains filtered or unexported fields
}

Handlers manages the set of check endpoints.

func New

func New(build string, db *sqlx.DB) *Handlers

New constructs a Handlers api for the check group.

func (*Handlers) Liveness

func (h *Handlers) Liveness(ctx context.Context, w http.ResponseWriter, r *http.Request) error

Liveness returns simple status info if the service is alive. If the app is deployed to a Kubernetes cluster, it will also return pod, node, and namespace details via the Downward API. The Kubernetes environment variables need to be set within your Pod/Deployment manifest.

func (*Handlers) Readiness

func (h *Handlers) Readiness(ctx context.Context, w http.ResponseWriter, r *http.Request) error

Readiness checks if the database is ready and if not will return a 500 status. Do not respond by just returning an error because further up in the call stack it will interpret that as a non-trusted error.

Jump to

Keyboard shortcuts

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