gvkimplementation

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package gvkimplementation provides a flexible registry that maps Kubernetes GroupVersionKinds (GVKs) to their corresponding handler and importer implementations.

This design enables easy extension beyond GitLab resources. For example, additional GVKs for Azure AD Groups or other providers can be registered without modifying existing logic—simply add new entries to the registry.

Functions:

  • IsAllowed: checks if a GVK is supported.
  • LookupByGVK: retrieves the implementation for a GVK.

Extending for other providers:

To support Azure AD Groups or other resource types, define the new GVK
and register its handler/importer in ImplementationByGVK. No changes to
the processing logic are required.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAllowed

func IsAllowed(gvk schema.GroupVersionKind) bool

IsAllowed checks whether the given GroupVersionKind (GVK) is present in the allowedGVKs set. It returns true if the GVK is permitted for processing, and false otherwise.

Types

type Implementation

type Implementation struct {
	Handler  handler.Handler
	Importer importer.Importer
}

Implementation contains Handler and Importer for specific resource implementation.

func LookupByGKV

func LookupByGKV(gkv schema.GroupVersionKind) (Implementation, bool)

LookupByGKV retrieves the implementation (handler and importer) associated with the given GroupVersionKind (GVK) from the implementationByGVK registry. It returns the implementation and a boolean indicating whether the GVK was found.

Jump to

Keyboard shortcuts

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