labels

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Label added in v1.1.0

type Label struct {
	// contains filtered or unexported fields
}

Label 標籤資料

func NewLabel added in v1.1.0

func NewLabel() *Label

NewLabel 建立標籤資料

type Labeler

type Labeler interface {
	// contains filtered or unexported methods
}

Labeler 標籤介面

type Labelmgr

type Labelmgr struct {
	// contains filtered or unexported fields
}

Labelmgr 標籤管理器, 讓使用者可以在可管理物件上新增/刪除標籤, 也可以通過標籤來取得管理中的物件; 建立可管理物件需要定義標籤結構, 並且把 Label 作為結構的第一個成員; 標籤必須是字串, 標籤可以關連到多個物件, 而物件也可以擁有多個標籤

func NewLabelmgr

func NewLabelmgr() *Labelmgr

NewLabelmgr 建立標籤管理器

func (*Labelmgr) Add

func (this *Labelmgr) Add(obj any, label ...string)

Add 新增標籤

func (*Labelmgr) Del

func (this *Labelmgr) Del(obj any, label ...string)

Del 刪除標籤

func (*Labelmgr) Erase

func (this *Labelmgr) Erase(obj any)

Erase 清除標籤

func (*Labelmgr) Get

func (this *Labelmgr) Get(label string) []any

Get 取得物件

func (*Labelmgr) Label

func (this *Labelmgr) Label(obj any) []string

Label 取得標籤

Jump to

Keyboard shortcuts

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