renderer

package
v0.18.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCritical

func IsCritical(e error) bool

IsCritical returns true of an error is critical.

func IsCriticalError

func IsCriticalError(e error, reason ErrorType) bool

IsCriticalError returns true of an error is a critical error of the given type.

func IsNonCritical

func IsNonCritical(e error) bool

IsNonCritical returns true of an error is critical.

func IsNonCriticalError

func IsNonCriticalError(e error, reason ErrorType) bool

IsNonCriticalError returns true of an error is a critical error of the given type.

func NewCriticalError

func NewCriticalError(reason ErrorType) error

NewCriticalError creates a new fatal error.

func NewNonCriticalError

func NewNonCriticalError(reason ErrorType) error

NewNonCriticalError creates a new non-critical render error object.

Types

type CriticalError

type CriticalError struct {
	TypedError
}

CriticalError is a fatal rendering error that prevents the rendering the dataplane config as a whole, or in parts.

func (*CriticalError) Error

func (e *CriticalError) Error() string

Error returns an error message.

type ErrorType

type ErrorType int

ErrorType species the type of a non-critical rendering error

const (
	NoError ErrorType = iota

	// critical
	InvalidAuthType
	InvalidUsernamePassword
	InvalidSharedSecret
	InvalidDataplane
	NoRuleFound
	ExternalAuthCredentialsNotFound
	InvalidAuthConfig
	RenderingError
	InternalError

	// noncritical
	InvalidBackendGroup
	InvalidBackendKind
	BackendNotFound
	ServiceNotFound
	ClusterIPNotFound
	EndpointNotFound
	InconsitentClusterType
	InvalidProtocol
	PortUnavailable
	InvalidPortRange
	PublicAddressNotFound
	PublicListenerAddressNotFound
)

type NonCriticalError

type NonCriticalError struct {
	TypedError
}

NonCriticalError is a non-fatal error that affects a Gateway or a Route status: this is an event that is worth reporting but otherwise does not prevent the rendering of a valid dataplane config.

func (*NonCriticalError) Error

func (e *NonCriticalError) Error() string

Error returns an error message.

type RenderContext

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

RenderContext contains the GatewayClass and the GatewayConfig for the current rendering task, plus additional metadata

func NewRenderContext

func NewRenderContext(e *event.EventRender, r *Renderer, gc *gwapiv1.GatewayClass) *RenderContext

func (*RenderContext) Merge added in v0.15.1

func (r *RenderContext) Merge(mergeable *RenderContext)

Merge merges the update queues of two rendering contexts.

type Renderer

type Renderer struct {
	*config.ProgressTracker
	// contains filtered or unexported fields
}

func NewRenderer

func NewRenderer(cfg RendererConfig) *Renderer

NewRenderer creates a new Renderer.

func (*Renderer) GetRenderChannel

func (r *Renderer) GetRenderChannel() chan event.Event

GetRenderChannel returns the channel onn which the renderer listenens to rendering requests.

func (*Renderer) Render

func (r *Renderer) Render(e *event.EventRender)

Render generates and sets a STUNner daemon configuration from the Gateway API running-config

func (*Renderer) SetOperatorChannel

func (r *Renderer) SetOperatorChannel(ch chan event.Event)

SetOperatorChannel sets the channel on which the operator event dispatcher listens.

func (*Renderer) Start

func (r *Renderer) Start(ctx context.Context) error

type RendererConfig

type RendererConfig struct {
	Scheme *runtime.Scheme
	Logger logr.Logger
}

type TypedError

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

Jump to

Keyboard shortcuts

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