tags

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const TagName = "tag"

Variables

This section is empty.

Functions

This section is empty.

Types

type Tag

type Tag struct {
	Name   string
	Values Values
}

Tag

func NewTag

func NewTag(name string, value interface{}) *Tag

NewTag creates a tag for supplied tag type

func (*Tag) Append

func (e *Tag) Append(value string)

Append appends tag value element

type Tags

type Tags []*Tag

Tags represents tags

func NewTags

func NewTags(tagLiteral string) Tags

NewTags create a tags for supplied tag literal

func (*Tags) Append

func (t *Tags) Append(tag string, value string)

Append appends tag values to existing tag or create a new tag

func (Tags) Index

func (t Tags) Index(name string) int

Index returns matched by name tag index

func (Tags) Lookup

func (t Tags) Lookup(name string) *Tag

Lookup returns matched by name tag

func (*Tags) Set

func (t *Tags) Set(tag string, value string)

Set sets tag value, if tag exists, overrides it

func (*Tags) SetIfNotFound

func (t *Tags) SetIfNotFound(tag string, value string)

func (*Tags) SetTag

func (t *Tags) SetTag(aTag *Tag)

SetTag sets tags, if tag exists, overrides it

func (Tags) Stringify

func (t Tags) Stringify() string

Stringify returns stringified tags representations

type Values

type Values string

Values represents tag values

func (Values) Match added in v0.5.4

func (v Values) Match(onMatch func(value string) error) error

Match matches elements separated by ,

func (Values) MatchPairs

func (v Values) MatchPairs(onMatch func(key, value string) error) error

MatchPairs matches paris separated by ,

func (Values) Name added in v0.5.5

func (v Values) Name() (string, Values)

Name returns tag value and remaining values

Jump to

Keyboard shortcuts

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