tagutils

package
v0.3.11-8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: Apache-2.0 Imports: 5 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 TagSet2Paths

func TagSet2Paths(tagSet TTagSet, keys []string) [][]string

func TagSetList2Paths

func TagSetList2Paths(tagsList TTagSetList, keys []string) [][]string

func Tagset2MapString

func Tagset2MapString(oTags TTagSet) map[string]string

func TagsetMap2MapString

func TagsetMap2MapString(oTags map[string]TTagSet) map[string]string

Types

type STag

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

func (STag) KeyPrefix

func (t STag) KeyPrefix() string

func (STag) String

func (t STag) String() string

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

* TagSet Append * 对相同的key,是并集 * 对不同的key,是交集 * 逻辑上有些问题,暂时这样 * * TODO: * type STag struct { * Key string * Values []string * } *

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

func (ts TTagSet) KeyPrefix() string

func (TTagSet) Len

func (a TTagSet) Len() int

func (TTagSet) Less

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

func (TTagSet) Remove

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

func (TTagSet) String

func (t TTagSet) String() string

func (TTagSet) Swap

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

type TTagSetList

type TTagSetList []TTagSet

func (TTagSetList) Append

func (tsl TTagSetList) Append(t TTagSet) TTagSetList

func (TTagSetList) AppendAll

func (tsl TTagSetList) AppendAll(tsl2 TTagSetList) 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() map[string]TTagSet

func (TTagSetList) Intersect

func (tsl TTagSetList) Intersect(t TTagSet) TTagSetList

func (TTagSetList) IntersectList

func (tsl TTagSetList) IntersectList(t TTagSetList) TTagSetList

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