controller

package
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackendHealthy   = "Healthy"
	BackendUnhealthy = "Unhealthy"
	BackendUnknown   = "Unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Callbacks

type Callbacks struct {
	OnSuccess func(be *proxy.BackendRuntime) error
	OnFailure func(be *proxy.BackendRuntime, err error) error
}

type Controller

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

func New

func New(cs *client.ClientSet, opts ...NewOption) *Controller

func (*Controller) NewHeartbeat

func (c *Controller) NewHeartbeat(name, kind string, be *backendv1.Probe, target *proxy.BackendRuntime, cb *Callbacks) *Heartbeat

func (*Controller) Run

func (c *Controller) Run(ctx context.Context)

type ControllerCache

type ControllerCache = compile.State

type Heartbeat

type Heartbeat struct {
	Name             string
	Kind             string
	Runtime          *proxy.BackendRuntime
	Path             string
	Timeout          time.Duration
	Period           time.Duration
	InitialDelay     time.Duration
	FailureThreshold uint64
	SuccessThreshold uint64
	Logger           logger.Logger
	FailureCount     atomic.Uint64
	SuccessCount     atomic.Uint64

	Callbacks Callbacks
	// contains filtered or unexported fields
}

func (*Heartbeat) Next

func (h *Heartbeat) Next(ctx context.Context) error

func (*Heartbeat) Stop

func (h *Heartbeat) Stop()

type NewOption

type NewOption func(c *Controller)

func WithCompiler

func WithCompiler(comp *compile.Compiler) NewOption

func WithExchange

func WithExchange(e *events.Exchange) NewOption

func WithHeartBeatInterval

func WithHeartBeatInterval(every time.Duration) NewOption

func WithHeartBeatTimeout

func WithHeartBeatTimeout(timeout time.Duration) NewOption

func WithLogger

func WithLogger(l logger.Logger) NewOption

func WithRuntime

func WithRuntime(runtime *proxyv2.RuntimeStore) NewOption

Jump to

Keyboard shortcuts

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