probe

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithReadinessHandler

func WithReadinessHandler(h http.Handler) interface{ Option }

WithReadinessHandler is an option to set a readiness handler for probe server.

Types

type Option

type Option interface {
	SetOption(*Server)
}

Option is ued to set probe server's options.

type Server

type Server struct {
	lifecycle.Readiness
	// contains filtered or unexported fields
}

Server is a http server for service probe.

func New

func New(port int, opts ...Option) *Server

New creates a new probe server.

func (*Server) Start

func (s *Server) Start(_ context.Context) error

Start starts the probe server and starts returning success status on liveness endpoint.

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop shutdown the probe server.

Jump to

Keyboard shortcuts

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