oor

package
v1.20.5 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package oor implements an opinionated standalone listener which can be used by load balancer to take the server instance out of rotation or bring it back in rotation. The instance will go out of rotation on receiving SIGUSR1 and can be brought back in rotation by sending SIGUSR2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Handler represents OOR handler.

func NewHandler

func NewHandler(inRotation bool) *Handler

NewHandler returns an OOR Handler. Initial state is defined by caller, and subsequent states are handled via SIGUSR1 and SIGUSR2

func (*Handler) InRotation

func (h *Handler) InRotation() bool

InRotation returns true if the server instance is ready to serve traffic.

Jump to

Keyboard shortcuts

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