nah

package module
v0.0.0-...-35a77e8 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRouter

func DefaultRouter(routerName string, scheme *runtime.Scheme) (*router.Router, error)

DefaultRouter The routerName is important as this name will be used to assign ownership of objects created by this router. Specifically, the routerName is assigned to the sub-context in the apply actions. Additionally, the routerName will be used for the leader election lease lock.

func NewRouter

func NewRouter(handlerName string, opts *Options) (*router.Router, error)

Types

type Options

type Options struct {
	// If the backend is nil, then DefaultRESTConfig, DefaultNamespace, and Scheme are used to create a backend.
	Backend backend.Backend
	// If a Backend is provided, then this is ignored. If not provided and needed, then a default is created with Scheme.
	RESTConfig *rest.Config
	// If a Backend is provided, then this is ignored.
	Namespace string
	// If a Backend is provided, then this is ignored.
	LabelSelector labels.Selector
	// If a Backend is provided, then this is ignored.
	FieldSelector fields.Selector
	// If a Backend is provided, then this is ignored.
	ByObject map[client.Object]cache.ByObject
	// If a Backend is provided, then this is ignored.
	Scheme *runtime.Scheme
	// ElectionConfig being nil represents no leader election for the router.
	ElectionConfig *leader.ElectionConfig
	// Defaults to 8888
	HealthzPort int
	// Change the threadedness per GVK
	GVKThreadiness map[schema.GroupVersionKind]int
	// Split the worker queues for these GVKs
	GVKQueueSplitters map[schema.GroupVersionKind]nruntime.WorkerQueueSplitter
}

func DefaultOptions

func DefaultOptions(routerName string, scheme *runtime.Scheme) (*Options, error)

DefaultOptions represent the standard options for a Router. The default leader election uses a lease lock and a TTL of 15 seconds.

Jump to

Keyboard shortcuts

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