Back to godoc.org

Package probe

v0.5.0
Latest Go to latest

The highest tagged major version is .

Published: Apr 21, 2019 | License: Apache-2.0 | Module: github.com/Frankonly/iotex-core

Index

func WithReadinessHandler

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

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

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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier