Documentation ¶
Overview ¶
Package tags 标签记录.
包括 打标,搜索等.
Index ¶
- func Byte2Ints[T constraints.Integer](n T, b byte) []T
- func Int2Byte[T constraints.Integer](i T) (T, byte)
- type Tags
- func (t *Tags[T]) Add(elems ...T) Tags[T]
- func (t *Tags[T]) AddTags(elem Tags[T]) Tags[T]
- func (t Tags[T]) All(elems ...T) bool
- func (t Tags[T]) Any(elems ...T) bool
- func (t Tags[T]) Bytes() []byte
- func (t Tags[T]) Count() int
- func (t Tags[T]) Del(elems ...T) Tags[T]
- func (t Tags[T]) DelTags(elem Tags[T]) Tags[T]
- func (t Tags[T]) Has(tag T) bool
- func (t Tags[T]) Join(sep string) string
- func (t *Tags[T]) Load(bs []byte)
- func (t Tags[T]) Slice() []T
- func (t Tags[T]) String() string
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Tags ¶
type Tags[T constraints.Integer] []byte
Tags 标签.
Example ¶
package main import ( "fmt" "gitee.com/xuender/oils/tags" ) func main() { tag := tags.NewTags(1, 2, 33) fmt.Println(tag.Has(1)) fmt.Println(tag.Has(3)) fmt.Println(tag.Has(33)) fmt.Println(tag) }
Output: true false true 1, 2, 33
func Intersection ¶ added in v1.0.27
func Intersection[T constraints.Integer](elems ...Tags[T]) Tags[T]
Intersection 交集. nolint
Click to show internal directories.
Click to hide internal directories.