tagutils

package
v0.3.9-2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 4 Imported by: 10

Documentation

Index

Constants

View Source
const (
	NoValue  = "___no_value__"
	AnyValue = ""
)

Variables

This section is empty.

Functions

func Compare

func Compare(t1, t2 STag) int

func Tagset2MapString

func Tagset2MapString(oTags TTagSet) map[string]string

Types

type STag

type STag struct {
	// 标签Kye
	Key string `json:"key"`
	// 标签Value
	Value string `json:"value"`
}

type STagFilters

type STagFilters struct {
	Filters   []map[string][]string
	NoFilters []map[string][]string
}

func (*STagFilters) AddFilter

func (tf *STagFilters) AddFilter(ts TTagSet)

func (*STagFilters) AddFilters

func (tf *STagFilters) AddFilters(tsl TTagSetList)

func (*STagFilters) AddNoFilter

func (tf *STagFilters) AddNoFilter(ts TTagSet)

func (*STagFilters) AddNoFilters

func (tf *STagFilters) AddNoFilters(tsl TTagSetList)

type TTagSet

type TTagSet []STag

func Map2Tagset

func Map2Tagset(meta map[string]string) TTagSet

func (TTagSet) Append

func (ts TTagSet) Append(ele ...STag) TTagSet

func (TTagSet) Compact

func (a TTagSet) Compact() TTagSet

func (TTagSet) Contains

func (a TTagSet) Contains(b TTagSet) bool

func (TTagSet) IsZero

func (t TTagSet) IsZero() bool

func (TTagSet) Remove

func (ts TTagSet) Remove(ele ...STag) TTagSet

func (TTagSet) String

func (t TTagSet) String() string

type TTagSetList

type TTagSetList []TTagSet

func (TTagSetList) Append

func (tsl TTagSetList) Append(t TTagSet) TTagSetList

func (TTagSetList) Contains

func (t1 TTagSetList) Contains(t2 TTagSet) bool

func (TTagSetList) ContainsAll

func (t1 TTagSetList) ContainsAll(t2 TTagSetList) bool

Contains of TTagSetList

tagsetlist t1 contains tagsetlist t2 means any tag set of t2 is
contained by one of the tag set of t1

func (TTagSetList) Flattern

func (tsl TTagSetList) Flattern() TTagSet

func (TTagSetList) IsEmpty

func (t1 TTagSetList) IsEmpty() bool

func (TTagSetList) Len

func (a TTagSetList) Len() int

func (TTagSetList) Less

func (a TTagSetList) Less(i, j int) bool

func (TTagSetList) String

func (tsl TTagSetList) String() string

func (TTagSetList) Swap

func (a TTagSetList) Swap(i, j int)

Jump to

Keyboard shortcuts

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