tags

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type B

type B = []byte

type E

type E = error

type N added in v0.0.14

type N = int

type S

type S = string

type T

type T struct {
	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 New

func New(fields ...*tag.T) (t *T)

func (*T) Append

func (t *T) Append(ttt ...*T)

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) Clone

func (t *T) Clone() (c *T)

func (*T) ContainsAny

func (t *T) ContainsAny(tagName B, values ...B) bool

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

func (*T) Equal

func (t *T) Equal(ta *T) bool

func (*T) FilterOut

func (t *T) FilterOut(tagPrefix []B) *T

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

func (*T) GetAll

func (t *T) GetAll(tagPrefix *tag.T) *T

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

func (*T) GetFirst

func (t *T) GetFirst(tagPrefix *tag.T) *tag.T

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

func (*T) GetLast

func (t *T) GetLast(tagPrefix *tag.T) *tag.T

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

func (*T) Len

func (t *T) Len() (l int)

func (*T) Less

func (t *T) Less(i, j int) (less bool)

Less evaluates two tags and returns if one is less than the other. Fields are lexicographically compared, so a < b.

If two tags are greater than or equal up to the length of the shortest.

func (*T) MarshalJSON

func (t *T) MarshalJSON(dst B) (b B, err error)

func (*T) MarshalTo

func (t *T) MarshalTo(dst B) []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.

todo: wut is this?

func (*T) String

func (t *T) String() string

func (*T) Swap

func (t *T) Swap(i, j int)

func (*T) ToStringSlice

func (t *T) ToStringSlice() (b [][]S)

func (*T) UnmarshalJSON

func (t *T) UnmarshalJSON(b B) (r B, err error)

Jump to

Keyboard shortcuts

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