health

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TransportWithDNSResponse

func TransportWithDNSResponse(overrides map[string]string) http.RoundTripper

TransportWithDNSResponse creates a new transport which overrides hostnames.

Types

type HealthRequest

type HealthRequest struct {
	Host, Path, Address      string
	Protocol                 v1alpha1.HealthProtocol
	Port                     int
	AdditionalHeaders        v1alpha1.AdditionalHeaders
	ExpectedResponses        []int
	AllowInsecureCertificate bool
	Notifier                 ProbeNotifier
}

type InstrumentedProbeNotifier

type InstrumentedProbeNotifier struct {
	// contains filtered or unexported fields
}

InstrumentedProbeNotifier wraps a notifier by incrementing the failure counter when the result is unhealthy

func NewInstrumentedProbeNotifier

func NewInstrumentedProbeNotifier(gatewayName, gatewayNamespace, listener string, notifier ProbeNotifier) *InstrumentedProbeNotifier

func (*InstrumentedProbeNotifier) Notify

type Monitor

type Monitor struct {
	ProbeQueuers []*ProbeQueuer
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor() *Monitor

func (*Monitor) AddProbeQueuer

func (m *Monitor) AddProbeQueuer(probeQueuer *ProbeQueuer) bool

func (*Monitor) HasProbe

func (m *Monitor) HasProbe(id string) bool

func (*Monitor) RemoveProbe

func (m *Monitor) RemoveProbe(id string)

func (*Monitor) Start

func (m *Monitor) Start(ctx context.Context) error

func (*Monitor) UpdateProbe

func (m *Monitor) UpdateProbe(id string, update func(*ProbeQueuer))

type NotificationResult

type NotificationResult struct {
	Requeue bool
}

type ProbeNotifier

type ProbeNotifier interface {
	Notify(ctx context.Context, result ProbeResult) (NotificationResult, error)
}

type ProbeQueuer

type ProbeQueuer struct {
	ID string

	Interval                 time.Duration
	Protocol                 v1alpha1.HealthProtocol
	Path                     string
	IPAddress                string
	Host                     string
	Port                     int
	AdditionalHeaders        v1alpha1.AdditionalHeaders
	ExpectedResponses        []int
	AllowInsecureCertificate bool

	Notifier ProbeNotifier
	Queue    *QueuedProbeWorker
	// contains filtered or unexported fields
}

func (*ProbeQueuer) Start

func (p *ProbeQueuer) Start()

func (*ProbeQueuer) Stop

func (p *ProbeQueuer) Stop()

type ProbeResult

type ProbeResult struct {
	CheckedAt time.Time
	Reason    string
	Status    int
	Healthy   bool
}

type QueuedProbeWorker

type QueuedProbeWorker struct {
	Throttle time.Duration
	// contains filtered or unexported fields
}

QueuedProbeWorker funnels incoming health check requests from health probes, processing them one at a time and spacing them by a specified duration

func NewRequestQueue

func NewRequestQueue(throttle time.Duration) *QueuedProbeWorker

func (*QueuedProbeWorker) EnqueueCheck

func (q *QueuedProbeWorker) EnqueueCheck(req HealthRequest)

func (*QueuedProbeWorker) Start

func (q *QueuedProbeWorker) Start(ctx context.Context) error

type StatusUpdateProbeNotifier

type StatusUpdateProbeNotifier struct {
	// contains filtered or unexported fields
}

func NewStatusUpdateProbeNotifier

func NewStatusUpdateProbeNotifier(apiClient client.Client, forObj *v1alpha1.DNSHealthCheckProbe) StatusUpdateProbeNotifier

func (StatusUpdateProbeNotifier) Notify

Jump to

Keyboard shortcuts

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