tags

package
v1.2.16 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: GPL-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

type T []tag.T

T is a list of T - which are lists of string elements with ordering and no uniqueness constraint (not a set).

func (T) AppendUnique

func (t T) AppendUnique(tag tag.T) T

AppendUnique appends a tag if it doesn't exist yet, otherwise does nothing. the uniqueness comparison is done based only on the first 2 elements of the tag.

func (T) ContainsAny

func (t T) ContainsAny(tagName string, values ...string) bool

ContainsAny returns true if any of the strings given in `values` matches any of the tag elements.

func (T) FilterOut

func (t T) FilterOut(tagPrefix []string) T

FilterOut removes all tags that match the prefix, see [T.StartsWith]

func (T) GetAll

func (t T) GetAll(tagPrefix ...string) T

GetAll gets all the tags that match the prefix, see [T.StartsWith]

func (T) GetFirst

func (t T) GetFirst(tagPrefix []string) *tag.T

GetFirst gets the first tag in tags that matches the prefix, see [T.StartsWith]

func (T) GetLast

func (t T) GetLast(tagPrefix []string) *tag.T

GetLast gets the last tag in tags that matches the prefix, see [T.StartsWith]

func (T) MarshalTo

func (t T) MarshalTo(dst []byte) []byte

MarshalTo appends the JSON encoded byte of T as [][]string to dst. String escaping is as described in RFC8259.

func (T) Scan

func (t T) Scan(src any) (err error)

Scan parses a string or raw bytes that should be a string and embeds the values into the tags variable from which this method is invoked.

func (T) Slice

func (t T) Slice() (slice [][]string)

func (T) String

func (t T) String() string

Jump to

Keyboard shortcuts

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