registry

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package registry implements the RuntimeSDK registry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtensionRegistration

type ExtensionRegistration struct {
	// Name is the unique name of the RuntimeExtension.
	Name string

	// ExtensionConfigName is the name of the corresponding ExtensionConfig.
	ExtensionConfigName string

	// GroupVersionHook is the GroupVersionHook that the RuntimeExtension implements.
	GroupVersionHook runtimecatalog.GroupVersionHook

	// NamespaceSelector limits the objects by namespace for which a Runtime Extension is called.
	NamespaceSelector labels.Selector

	// ClientConfig is the ClientConfig to communicate with the RuntimeExtension.
	ClientConfig runtimev1.ClientConfig

	// TimeoutSeconds is the timeout duration used for calls to the RuntimeExtension.
	TimeoutSeconds *int32

	// FailurePolicy defines how failures in calls to the RuntimeExtension should be handled by a client.
	FailurePolicy *runtimev1.FailurePolicy

	// Settings captures additional information sent in call to the RuntimeExtensions.
	Settings map[string]string
}

ExtensionRegistration contains information about a registered RuntimeExtension.

type ExtensionRegistry

type ExtensionRegistry interface {
	// WarmUp can be used to initialize a "cold" RuntimeExtension registry with all
	// known runtimev1.ExtensionConfigs at a given time.
	// After WarmUp completes the RuntimeExtension registry is considered ready.
	WarmUp(extensionConfigList *runtimev1.ExtensionConfigList) error

	// IsReady returns true if the RuntimeExtension registry is ready for usage.
	// This happens after WarmUp is completed.
	IsReady() bool

	// Add adds all RuntimeExtensions of the given ExtensionConfig.
	// Please note that if the ExtensionConfig has been added before, the
	// corresponding registry entries will get updated/replaced with the
	// one from the newly provided ExtensionConfig.
	Add(extensionConfig *runtimev1.ExtensionConfig) error

	// Remove removes all RuntimeExtensions corresponding to the provided ExtensionConfig.
	Remove(extensionConfig *runtimev1.ExtensionConfig) error

	// List lists all registered RuntimeExtensions for a given catalog.GroupHook.
	List(gh runtimecatalog.GroupHook) ([]*ExtensionRegistration, error)

	// Get gets the RuntimeExtensions with the given name.
	Get(name string) (*ExtensionRegistration, error)
}

ExtensionRegistry defines the funcs of a RuntimeExtension registry.

func New

func New() ExtensionRegistry

New returns a new ExtensionRegistry.

Jump to

Keyboard shortcuts

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