label

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: Apache-2.0 Imports: 9 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 ListCSPResourceLabel added in v0.10.7

func ListCSPResourceLabel(labelType, uid string, connectionName string) (labels map[string]string)

ListCSPResourceLabel best-effort lists the labels of a resource in the CSP

func MatchesLabelSelector

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

MatchesLabelSelector checks if the labels match the given label selector.

func MergeCSPResourceLabel added in v0.10.7

func MergeCSPResourceLabel(labelType, uid string, resourceKey string) error

MergeCSPResourceLabel merges the labels of a resource in the CSP with the existing labels

func RemoveCSPResourceLabel added in v0.10.7

func RemoveCSPResourceLabel(labelType, uid string, key string, connectionName string)

RemoveCSPResourceLabel best-effort removes the labels of a resource in the CSP

func RemoveLabel

func RemoveLabel(labelType, uid, key string) error

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

func UpdateCSPResourceLabel added in v0.10.7

func UpdateCSPResourceLabel(labelType, uid string, labels map[string]string, connectionName string)

UpdateCSPResourceLabel best-effort updates the labels of a resource in the CSP

Types

This section is empty.

Jump to

Keyboard shortcuts

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