info

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port       int
	Statistics bool
}

Config contains params to setup info handler

type ProbeChecker

type ProbeChecker func() error

ProbeChecker defines simple function for probe checks

type Service

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

Service contains info/health-check functionality

func NewService

func NewService(logger *zap.Logger) *Service

NewService creates new service with info/health-check handlers

func (*Service) AddHandler

func (s *Service) AddHandler(path string, handler http.HandlerFunc)

AddHandler adds new handler with given path to info service

func (*Service) RegisterLivenessProbe

func (s *Service) RegisterLivenessProbe(checker ProbeChecker)

RegisterLivenessProbe defines liveness probe function

func (*Service) RegisterReadinessProbe

func (s *Service) RegisterReadinessProbe(checker ProbeChecker)

RegisterReadinessProbe defines readiness probe function

func (*Service) Run

func (s *Service) Run(addr string) *http.Server

Run info/health-check service

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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