probe

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 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 {
	// 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) NotReady

func (s *Server) NotReady()

NotReady makes the probe server starts returning failure status on readiness and health endpoint.

func (*Server) Ready

func (s *Server) Ready()

Ready makes the probe server starts returning status on readiness and health endpoint.

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