Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

info

v0.1.8
github.com/takama/grpc/pkg/info

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

10 matches

Top ↑

Types

Config

type Config struct {
	Port       int
	Statistics bool
}

Config contains params to setup info handler.

ProbeChecker

type ProbeChecker func() error

ProbeChecker defines simple function for probe checks.

Service

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

Service contains info/health-check functionality.

NewService

func NewService(logger *zap.Logger) *Service

NewService creates new service with info/health-check handlers.

Service.AddHandler

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

AddHandler adds new handler with given path to info service.

Service.RegisterLivenessProbe

func (s *Service) RegisterLivenessProbe(checker ProbeChecker)

RegisterLivenessProbe defines liveness probe function.

Service.RegisterReadinessProbe

func (s *Service) RegisterReadinessProbe(checker ProbeChecker)

RegisterReadinessProbe defines readiness probe function.

Service.Run

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

Run info/health-check service.

Service.ServeHTTP

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

Dependency graph