metadata

package
v0.0.43 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

View Source
const (

	// AnnotationKeyTags is the annotation key used to set tags on resources.
	AnnotationKeyTags = annotationPrefix + "/tags"

	// AnnotationKeyPlugins is the annotation key used to attach KongPlugins to resources.
	AnnotationKeyPlugins = annotationPrefix + "/plugins"
)

Variables

This section is empty.

Functions

func ExtractPlugins added in v0.0.38

func ExtractPlugins(obj ObjectWithAnnotationsAndNamespace) []string

ExtractPlugins extracts plugin names from the given object's konghq.com/plugins annotation. This function trims the whitespace from the plugin names.

For example, for KongConsumer in namespace default, having the "konghq.com/plugins" annotation set to "p1,p2" this will return []string{"p1", "p2"}

func ExtractPluginsNamespacedNames added in v0.0.42

func ExtractPluginsNamespacedNames(obj ObjectWithAnnotationsAndNamespace) []types.NamespacedName

ExtractPluginsNamespacedNames extracts plugin namespaced names from the given object's konghq.com/plugins annotation. Plugins can optionally specify the namespace using the "<namespace>:<plugin-name>" format. This function trims the whitespace from the plugin names.

For example, for an object having the "konghq.com/plugins" annotation set to "default:p1,p2" this will return:

 []types.NamespacedName{
		types.NamespacedName{Namespace: "default", Name: "p1"},
		types.NamespacedName{Namespace: "", Name: "p2"},
	}

func ExtractPluginsWithNamespaces added in v0.0.38

func ExtractPluginsWithNamespaces(obj ObjectWithAnnotationsAndNamespace) []string

ExtractPluginsWithNamespaces extracts plugin namespaced names from the given object's konghq.com/plugins annotation. This function trims the whitespace from the plugin names.

For example, for KongConsumer in namespace default, having the "konghq.com/plugins" annotation set to "p1,p2" this will return []string{"default/p1", "default/p2"}

Types

type ObjectWithAnnotations

type ObjectWithAnnotations interface {
	GetAnnotations() map[string]string
}

ObjectWithAnnotations is an interface that provides a method to get annotations.

type ObjectWithAnnotationsAndNamespace added in v0.0.38

type ObjectWithAnnotationsAndNamespace interface {
	ObjectWithAnnotations
	GetNamespace() string
}

ObjectWithAnnotationsAndNamespace is an interface that provides a method to get annotations and namespace.

Jump to

Keyboard shortcuts

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