tag

package
v1.5.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

func NewCollector

func NewCollector(tagManager *tags.Manager, logger *logrus.Logger) *Collector

func (*Collector) BuildTagCache

func (c *Collector) BuildTagCache() error

BuildTagCache caches all tag and categories from vCenter and stores them for future reference each invocation of this func will clear any previously cached values

func (*Collector) FetchTagsForObjects

func (c *Collector) FetchTagsForObjects(objectsSlice interface{}) (TagsByObject, error)

func (*Collector) GetTagByID

func (c *Collector) GetTagByID(id string) Tag

GetTagById gets a tag by it's id

func (*Collector) GetTagsByCategories

func (c *Collector) GetTagsByCategories(ref mor) map[string]string

GetTagsByCategories return a map of tags categories and the corresponding tags associated to the object

func (*Collector) GetTagsForObject

func (c *Collector) GetTagsForObject(or mor) []Tag

GetTagsForObject gets all tags for a object

func (*Collector) MatchObjectTags

func (c *Collector) MatchObjectTags(resource mor) bool

MatchObjectTags checks if any tag in the resource tags matches any of the 'filterTags'

func (*Collector) ParseFilterTagExpression

func (c *Collector) ParseFilterTagExpression(tagFilterExpression string)

ParseFilterTagExpression converts a filter tag expression into a slice of Tag example: tag=value tag1=value1 --> t:{c: tag, n: value}, t1:{c: tag1, n: value1} each invocation of this function resets any previously created filter

type Tag

type Tag struct {
	Name     string
	Category string
}

type TagsByID

type TagsByID map[string]Tag

TagsByID stores tags per tag id

type TagsByObject

type TagsByObject = map[mor][]Tag

TagsByID stores tags per object

Jump to

Keyboard shortcuts

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