checkapp

package
v0.0.0-...-76f82ff Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package checkapp maintains the app layer api for the check domain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App manages the set of app layer api functions for the check domain.

func NewApp

func NewApp(build string, log *logger.Logger, db *sqlx.DB) *App

NewApp constructs a check app API for use.

func (*App) Liveness

func (a *App) Liveness() Info

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 (*App) Readiness

func (a *App) Readiness(ctx context.Context) 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.

type Info

type Info struct {
	Status     string `json:"status,omitempty"`
	Build      string `json:"build,omitempty"`
	Host       string `json:"host,omitempty"`
	Name       string `json:"name,omitempty"`
	PodIP      string `json:"podIP,omitempty"`
	Node       string `json:"node,omitempty"`
	Namespace  string `json:"namespace,omitempty"`
	GOMAXPROCS int    `json:"GOMAXPROCS,omitempty"`
}

Info represents information about the service.

func (Info) Encode

func (app Info) Encode() ([]byte, string, error)

Encode implements the encoder interface.

Jump to

Keyboard shortcuts

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