tags

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tagger

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

func (*Tagger) AddTags

func (ts *Tagger) AddTags(tags []string) error

AddTags adds the listed tags to any entity selected. The tags are added in the order they are listed.

func (*Tagger) GetData

func (ts *Tagger) GetData() map[string]interface{}

GetData returns the (modified) document.

func (*Tagger) ListTags

func (ts *Tagger) ListTags() ([]string, error)

ListTags returns a list of the tags in use in the data. The tags are sorted.

func (*Tagger) RemoveTags

func (ts *Tagger) RemoveTags(tags []string, removeEmptyTagArrays bool) error

RemoveTags removes the listed tags from any entity selected. Empty tag arrays are removed if 'removeEmptyTagArrays' is true. The order of the remaining tags is preserved.

func (*Tagger) RemoveUnknownTags

func (ts *Tagger) RemoveUnknownTags(knownTags []string, removeEmptyTagArrays bool) error

RemoveUnknownTags removes all tags that are not in the list of known tags. If removeEmptyTagArrays is true, it will also remove any empty tags arrays.

func (*Tagger) SetData

func (ts *Tagger) SetData(data map[string]interface{})

SetData sets the Yaml document to operate on. Cannot be set to nil (panic).

func (*Tagger) SetSelectors

func (ts *Tagger) SetSelectors(selectors []string) error

SetSelectors sets the selectors to use. If empty (or nil), the default selectors are set.

Jump to

Keyboard shortcuts

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