healthcheckendpoint

package
v0.0.0-...-32f485c Latest Latest
Warning

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

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

Documentation

Overview

Package health check provides a library to run a new gRPC server that implements the gRPC Health Check Protocol. This is intended to be used by our tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Lis net.Listener
	// contains filtered or unexported fields
}

Server represents the gRPC health checkable server. The address the server is listening on can be extracted from this struct.

func NewServer

func NewServer() (*Server, error)

NewServer creates a new server but does not start it. This sets up the listening address and the initial health.

func (*Server) StartServer

func (s *Server) StartServer(startTime time.Duration, healthyTime time.Duration)

StartServer starts the gRPC server with two durations. StartTime is the amount of time it takes to actually start serving the endpoints. HealthyTime is the amount of time it takes for the service to be considered healthy.

Example: startTime = 2 sec, healthyTime = 3 sec

Tick 0: Server not running
Tick 1: Server not running
Tick 2: Server running but unhealthy
Tick 3: Server running and healthy

func (*Server) StopServer

func (s *Server) StopServer()

Jump to

Keyboard shortcuts

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