label

package
v0.10.6 Latest Latest
Warning

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

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

Documentation

Overview

Package label is to handle label selector for resources

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdateLabel

func CreateOrUpdateLabel(labelType, uid string, resourceKey string, labels map[string]string) error

CreateOrUpdateLabel adds a new label or updates an existing label for the given resource, and then persists the updated label information in the Key-Value store.

func DeleteLabelObject added in v0.9.10

func DeleteLabelObject(labelType, uid string) error

DeleteLabelObject deletes the entire label object for a given resource identified by its labelType and uid.

func GetLabels

func GetLabels(labelType, uid string) (label model.LabelInfo, err error)

GetLabels retrieves the labels for a resource identified by its uid.

func GetResourcesByLabelSelector

func GetResourcesByLabelSelector(labelType, labelSelector string) ([]interface{}, error)

GetResourcesByLabelSelector retrieves resources based on a label selector.

func MatchesLabelSelector

func MatchesLabelSelector(labels map[string]string, labelSelector string) bool

MatchesLabelSelector checks if the labels match the given label selector.

func RemoveLabel

func RemoveLabel(labelType, uid, key string) error

RemoveLabel removes a label from a resource identified by its uid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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