event

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigConf added in v0.17.0

type ConfigConf = []*stnrv1.StunnerConfig

render event

type Event

type Event interface {
	GetType() EventType
	String() string
}

Event defines an event sent to/from the operator

type EventAck added in v0.19.0

type EventAck struct {
	Type       EventType
	Generation int
}

EventAck is used by the updater to acknowledge that the update has finished.

func NewEventAck added in v0.19.0

func NewEventAck(gen int) *EventAck

NewEventAcknowledgement returns an empty event.

func (*EventAck) GetType added in v0.19.0

func (e *EventAck) GetType() EventType

func (*EventAck) String added in v0.19.0

func (e *EventAck) String() string

type EventFinalize added in v0.19.0

type EventFinalize struct {
	Type       EventType
	Generation int
}

EventFinalize is an event that requests the renderer to invalidate managed resources.

func NewEventFinalize added in v0.19.0

func NewEventFinalize(gen int) *EventFinalize

NewEvent returns an empty event

func (*EventFinalize) GetType added in v0.19.0

func (e *EventFinalize) GetType() EventType

func (*EventFinalize) String added in v0.19.0

func (e *EventFinalize) String() string

type EventReconcile added in v0.19.0

type EventReconcile struct {
	Type EventType
}

reconcile event

func NewEventReconcile added in v0.19.0

func NewEventReconcile() *EventReconcile

NewEvent returns an empty event

func (*EventReconcile) GetType added in v0.19.0

func (e *EventReconcile) GetType() EventType

func (*EventReconcile) String added in v0.19.0

func (e *EventReconcile) String() string

type EventRender

type EventRender struct {
	Type       EventType
	Generation int
}

render event

func NewEventRender

func NewEventRender(gen int) *EventRender

NewEvent returns an empty event

func (*EventRender) GetType

func (e *EventRender) GetType() EventType

func (*EventRender) String

func (e *EventRender) String() string

type EventType

type EventType int

EventType specifies the type of an event sent by the threads of the operator.

const (
	EventTypeUnknown EventType = iota + 1
	// EventTypeRender is sent by the operator to the renderer to request rendering.
	EventTypeRender
	// EventTypeReconcile is sent by the controllers to the operator to trigger reconciliation.
	EventTypeReconcile
	// EventTypeUpdate is created by the renderer thread holding a set of Kubernetes resources
	// that must be crater, updated or deleted. The event is sent from the renderer to the
	// operator, which passes the event on the updater thread for processing.
	EventTypeUpdate
	// EventTypeFinalize is sent from the operator to the renderer to commence the finalization
	// cycle.
	EventTypeFinalize
	// EventTypeFinalize is used by the updater to acknowledge that it has finished processing
	// an update generation.
	EventTypeAck
)

func NewEventType

func NewEventType(raw string) (EventType, error)

NewEventType parses an event type specification

func (EventType) String

func (a EventType) String() string

String returns a string representation for an event

type EventUpdate

type EventUpdate struct {
	Type        EventType
	UpsertQueue UpdateConf
	DeleteQueue UpdateConf
	ConfigQueue ConfigConf
	Generation  int
	RequestAck  bool
}

func NewEventUpdate

func NewEventUpdate(generation int) *EventUpdate

NewEvent returns an empty event

func (*EventUpdate) DeepCopy added in v0.18.0

func (e *EventUpdate) DeepCopy() *EventUpdate

DeepCopy copies all updated resources into a new update event. This is required to elide locking across the renderer thread and the updater thread.

func (*EventUpdate) GetRequestAck added in v0.19.0

func (e *EventUpdate) GetRequestAck() bool

GetRequestAck returns true of the event contains an acknowledgement request.

func (*EventUpdate) GetType

func (e *EventUpdate) GetType() EventType

func (*EventUpdate) SetRequestAck added in v0.19.0

func (e *EventUpdate) SetRequestAck(b bool)

RequestAck asks the updater to send an acknowledgement.

func (*EventUpdate) String

func (e *EventUpdate) String() string

type UpdateConf

type UpdateConf struct {
	GatewayClasses *store.GatewayClassStore
	Gateways       *store.GatewayStore
	UDPRoutes      *store.UDPRouteStore
	UDPRoutesV1A2  *store.UDPRouteStore
	Services       *store.ServiceStore
	ConfigMaps     *store.ConfigMapStore
	Deployments    *store.DeploymentStore
}

Jump to

Keyboard shortcuts

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