Documentation ¶
Index ¶
- func AddMetadataAsTags(name, value string, metadataAsTags map[string]string, ...)
- func ComputeTagsHash(tags []string) string
- func ConcatenateTags(slices [][]string) []string
- func InitMetadataAsTags(metadataAsTags map[string]string) (map[string]string, map[string]glob.Glob)
- func StringInRuneset(name, subset string) bool
- type Expire
- type TagList
- func (l *TagList) AddAuto(name, value string)
- func (l *TagList) AddHigh(name string, value string)
- func (l *TagList) AddLow(name string, value string)
- func (l *TagList) AddOrchestrator(name string, value string)
- func (l *TagList) AddStandard(name string, value string)
- func (l *TagList) Compute() ([]string, []string, []string, []string)
- func (l *TagList) Copy() *TagList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMetadataAsTags ¶ added in v0.9.0
func AddMetadataAsTags(name, value string, metadataAsTags map[string]string, glob map[string]glob.Glob, tags *TagList)
AddMetadataAsTags converts name and value into tags based on the metadata as tags configuration and patterns
func ComputeTagsHash ¶ added in v0.9.0
ComputeTagsHash returns a hash of the supplied tags.
func ConcatenateTags ¶
ConcatenateTags is a fast way to concatenate multiple tag arrays in a single one.
func InitMetadataAsTags ¶ added in v0.9.0
InitMetadataAsTags prepares labels and annotations as tags - It lower-case all the labels in metadataAsTags - It compiles all the patterns and stores them in a map of glob.Glob objects
func StringInRuneset ¶
StringInRuneset tests whether all runes of a string are in a given subset returns false if any rune in the string is not found in the subset
Types ¶
type Expire ¶
Expire implements a simple last-seen-time-based expiry logic for watching for disappearing entities (for triggering events or just cache housekeeping). User classes define an expiry delay, then call Update every time they encounter a given entity. ComputeExpires() returns the entity names that have not been seen for longer than the configured delay. As Expire keeps an internal state of entity names, Update will return true if a name is new, false otherwise.
func (*Expire) ComputeExpires ¶
ComputeExpires should be called right after an Update.
type TagList ¶
type TagList struct {
// contains filtered or unexported fields
}
TagList allows collector to incremental build a tag list then export it easily to []string format
func (*TagList) AddAuto ¶
AddAuto determine the tag cardinality and will call the proper method AddLow or AddHigh if the name value starts with '+' character
func (*TagList) AddHigh ¶
AddHigh adds a new high cardinality tag to the map, or replace if already exists. It will skip empty values/names, so it's safe to use without verifying the value is not empty.
func (*TagList) AddLow ¶
AddLow adds a new low cardinality tag to the list, or replace if already exists. It will skip empty values/names, so it's safe to use without verifying the value is not empty.
func (*TagList) AddOrchestrator ¶
AddOrchestrator adds a new orchestrator-level cardinality tag to the map, or replice if already exists. It will skip empty values/names, so it's safe to use without verifying the value is not empty.
func (*TagList) AddStandard ¶
AddStandard adds a new standard tag to the list, or replace if already exists. It adds the standard tag to the low cardinality tag list as well. It will skip empty values/names, so it's safe to use without verifying the value is not empty.