tags

package
v1.0.58 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package tags 标签记录.

包括 打标,搜索等.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Byte2Ints

func Byte2Ints(n uint32, b byte) []uint32

Byte2Ints 字节码转换整数.

func Int2Byte

func Int2Byte(i uint32) (uint32, byte)

Int2Byte 整数转换字节码.

Types

type Tags

type Tags []byte

Tags 标签.

Example
package main

import (
	"fmt"

	"gitee.com/xuender/oils/tags"
)

func main() {
	ts := tags.NewTags(1, 2, 33)

	fmt.Println(ts.Has(1))
	fmt.Println(ts.Has(3))
	fmt.Println(ts.Has(33))
	fmt.Println(ts)

}
Output:

true
false
true
1, 2, 33

func Intersection added in v1.0.27

func Intersection(elems ...Tags) Tags

Intersection 交集.

func NewTags

func NewTags(elems ...uint32) Tags

NewTags 新建标签.

func (*Tags) Add

func (t *Tags) Add(elems ...uint32) Tags

Add 增加标签.

func (*Tags) AddTags added in v1.0.9

func (t *Tags) AddTags(elem Tags) Tags

AddTags 增加标签.

func (Tags) All

func (t Tags) All(elems ...uint32) bool

All 全部包含.

func (Tags) Any

func (t Tags) Any(elems ...uint32) bool

Any 包含任意.

func (Tags) Bytes added in v1.0.30

func (t Tags) Bytes() []byte

Bytes 字节码.

func (Tags) Count added in v1.0.24

func (t Tags) Count() int

Count 标签数量.

func (Tags) Del

func (t Tags) Del(elems ...uint32) Tags

Del 删除标签.

func (Tags) DelTags added in v1.0.9

func (t Tags) DelTags(elem Tags) Tags

DelTags 删除标签.

func (Tags) Has

func (t Tags) Has(tag uint32) bool

Has 包含标签.

func (Tags) Join

func (t Tags) Join(sep string) string

Join 集合连接.

func (*Tags) Load added in v1.0.30

func (t *Tags) Load(bs []byte) error

Load 加载.

func (Tags) Slice

func (t Tags) Slice() []uint32

Slice 转换切片.

func (Tags) String

func (t Tags) String() string

String 字符串.

Jump to

Keyboard shortcuts

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