health

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package health contains code for health checks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVersion added in v0.0.3

func GetVersion() string

GetVersion returns service's version and commit.

func SetupRouter

func SetupRouter(r chi.Router, p ...Pinger)

SetupRouter setups all pingers to /health.

Types

type Pinger

type Pinger interface {
	Ping(ctx context.Context) error
}

Pinger pings external service.

func SubjectPinger

func SubjectPinger(s string, f func(ctx context.Context) error) Pinger

SubjectPinger returns wrapper over Ping function which adds subject to error message. It is helpful for external Ping function, e.g. (sql.DB).Ping.

type VersionResponse

type VersionResponse struct {
	Version string `json:"version"`
	Commit  string `json:"commit"`
}

VersionResponse ...

Jump to

Keyboard shortcuts

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