tagging

package
v14.2.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTagSliceToMap

func ParseTagSliceToMap(tags []string) map[string]string

ParseTagSliceToMap handles splitting a slice of string tags on `:` and creating a map from the parts.

Types

type ExtendTags

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

ExtendTags holds the pre-calculated data to apply the "extend tags" operation on a slice of strings representing some tags

func NewExtendTags

func NewExtendTags(tags []string) ExtendTags

NewExtendTags creates a new ExtraTags struct, including the pre-calculation of prefixes to drop. Empty tags are ignored.

func (*ExtendTags) Extend

func (et *ExtendTags) Extend(tags []string, mutate bool) []string

Extend takes as input a slice of tags as a string, and returns a sorted slice of tags including those specified by ExtraTags. Tags present in ExtraTags will override any present in the input based on their key component (the text before any `:`)

func (*ExtendTags) ExtendMap

func (et *ExtendTags) ExtendMap(tags map[string]string, mutate bool) map[string]string

ExtendMap merges the extra tags into the provided map

Jump to

Keyboard shortcuts

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