handler

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2025 HAProxy Technologies LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandler

type EventHandler interface {
	// HandleEventBatch handles a batch of events.
	// EventBatch can include duplicated events.
	HandleEventBatch(ctx context.Context, batch events.EventBatch)
}

EventHandler handles a batch of events. Its builds a ClusterStore of k8s resources.

func NewEventHandlerImpl

func NewEventHandlerImpl(
	clusterStore *store.ClusterStore,
	gateTreeConfig GateTreeConfig,
	haproxyCfgManagerParams haproxy.HaproxyConfMgrParams,
	initialStructuredConf structured.Structured,
	haproxyClient hapi.HAProxyClient,
) EventHandler

NewEventHandlerImpl creates a new eventHandlerImpl.

type EventLoop

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

func NewEventLoop

func NewEventLoop(
	loopCfg EventLoopConfig,
	eventCh <-chan any,
	logger *slog.Logger,
	handler EventHandler,
	extractGVK utilsk8s.ExtractGVK,
) *EventLoop

NewEventLoop creates a new EventLoop.

func (*EventLoop) GetHandling

func (el *EventLoop) GetHandling() bool

func (*EventLoop) NeedLeaderElection

func (*EventLoop) NeedLeaderElection() bool

func (*EventLoop) SetHandling

func (el *EventLoop) SetHandling(value bool)

func (*EventLoop) Start

func (el *EventLoop) Start(ctx context.Context) error

Start starts the EventLoop. This method will block until the EventLoop stops, which will happen after the ctx is closed.

type EventLoopConfig

type EventLoopConfig struct {
	SyncPeriod        time.Duration
	StartupSyncPeriod time.Duration
}

type GateTreeBuilder

type GateTreeBuilder struct {
	*tree.ControllerStore
	// contains filtered or unexported fields
}

func NewGateTreeBuilder

func NewGateTreeBuilder(controllerStore *tree.ControllerStore, cfg GateTreeConfig) GateTreeBuilder

func (*GateTreeBuilder) GetTree

func (b *GateTreeBuilder) GetTree() *tree.GateTree

type GateTreeConfig

type GateTreeConfig struct {
	// k8sClient is a Kubernetes API client.
	K8sClient client.Client
	// k8sReader is a Kubernets API reader.
	K8sReader                  client.Reader
	CertificateStorage         storage.CertificateStorage
	MapsStorage                storage.MapsStorageEx
	BaseLogger                 *slog.Logger
	LogCategoryFilterHandler   *logging.CategoryFilterHandler
	ExtractGVK                 utilsk8s.ExtractGVK
	TransferHaproxyConfChannel chan diffs.HaproxyConfDiffs
	//  Namespace and name of the controller conf CRD
	ControllerConfNsName types.NamespacedName
	// ControllerName
	ControllerName string
	// StoreCertificatesOnDisk is a flag that indicates to the gate library to store certificates on disk
	StoreCertificateOnDisk bool
	// StoreMapsOnDisk is a flag that indicates to the gate library to store maps on disk
	StoreMapsOnDisk bool
	// RuntimeUpdateHaproxy
	RuntimeUpdateHaproxy bool
}

Jump to

Keyboard shortcuts

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