tag

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyLabel     = errors.New("tag label can't be empty")
	ErrInvalidSceneID = errors.New("invalid scene ID")
)
View Source
var DatasetFieldIDFrom = id.DatasetFieldIDFrom
View Source
var DatasetFieldIDFromRef = id.DatasetFieldIDFromRef
View Source
var DatasetIDFrom = id.DatasetIDFrom
View Source
var DatasetIDFromRef = id.DatasetIDFromRef
View Source
var DatasetSchemaIDFrom = id.DatasetSchemaIDFrom
View Source
var DatasetSchemaIDFromRef = id.DatasetSchemaIDFromRef
View Source
var ErrInvalidID = id.ErrInvalidID
View Source
var IDFrom = id.TagIDFrom
View Source
var IDFromRef = id.TagIDFromRef
View Source
var MustDatasetFieldID = id.MustDatasetFieldID
View Source
var MustDatasetID = id.MustDatasetID
View Source
var MustDatasetSchemaID = id.MustDatasetSchemaID
View Source
var MustID = id.MustTagID
View Source
var MustSceneID = id.MustSceneID
View Source
var NewDatasetFieldID = id.NewDatasetFieldID
View Source
var NewDatasetID = id.NewDatasetID
View Source
var NewDatasetSchemaID = id.NewDatasetSchemaID
View Source
var NewID = id.NewTagID
View Source
var NewSceneID = id.NewSceneID
View Source
var SceneIDFrom = id.SceneIDFrom
View Source
var SceneIDFromRef = id.SceneIDFromRef

Functions

This section is empty.

Types

type DatasetFieldID added in v0.4.0

type DatasetFieldID = id.DatasetFieldID

type DatasetID added in v0.4.0

type DatasetID = id.DatasetID

type DatasetSchemaID added in v0.4.0

type DatasetSchemaID = id.DatasetSchemaID

type Group

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

func GroupFrom

func GroupFrom(t Tag) *Group

func ToTagGroup

func ToTagGroup(t Tag) *Group

func (*Group) AddTag added in v0.7.0

func (g *Group) AddTag(ids ...ID)

func (*Group) ID

func (t *Group) ID() ID

func (*Group) Label

func (t *Group) Label() string

func (*Group) RemoveTag added in v0.6.1

func (g *Group) RemoveTag(ids ...ID)

func (*Group) Rename

func (t *Group) Rename(s string)

func (*Group) Scene

func (t *Group) Scene() SceneID

func (*Group) Tags

func (g *Group) Tags() IDList

type GroupBuilder

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

func NewGroup

func NewGroup() *GroupBuilder

func (*GroupBuilder) Build

func (b *GroupBuilder) Build() (*Group, error)

func (*GroupBuilder) ID

func (b *GroupBuilder) ID(tid ID) *GroupBuilder

func (*GroupBuilder) Label

func (b *GroupBuilder) Label(l string) *GroupBuilder

func (*GroupBuilder) MustBuild added in v0.5.0

func (b *GroupBuilder) MustBuild() *Group

func (*GroupBuilder) NewID

func (b *GroupBuilder) NewID() *GroupBuilder

func (*GroupBuilder) Scene

func (b *GroupBuilder) Scene(sid SceneID) *GroupBuilder

func (*GroupBuilder) Tags

func (b *GroupBuilder) Tags(tl IDList) *GroupBuilder

type ID added in v0.4.0

type ID = id.TagID

type IDList added in v0.5.0

type IDList = id.TagIDList

type Item

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

func ItemFrom

func ItemFrom(t Tag) *Item

func ToTagItem

func ToTagItem(t Tag) *Item

func (*Item) ID

func (t *Item) ID() ID

func (*Item) Label

func (t *Item) Label() string

func (*Item) LinkedDatasetFieldID

func (i *Item) LinkedDatasetFieldID() *DatasetFieldID

func (*Item) LinkedDatasetID

func (i *Item) LinkedDatasetID() *DatasetID

func (*Item) LinkedDatasetSchemaID

func (i *Item) LinkedDatasetSchemaID() *DatasetSchemaID

func (*Item) Parent added in v0.3.0

func (i *Item) Parent() *ID

func (*Item) Rename

func (t *Item) Rename(s string)

func (*Item) Scene

func (t *Item) Scene() SceneID

func (*Item) SetParent added in v0.3.0

func (i *Item) SetParent(p *ID)

type ItemBuilder

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

func NewItem

func NewItem() *ItemBuilder

func (*ItemBuilder) Build

func (b *ItemBuilder) Build() (*Item, error)

func (*ItemBuilder) ID

func (b *ItemBuilder) ID(tid ID) *ItemBuilder

func (*ItemBuilder) Label

func (b *ItemBuilder) Label(l string) *ItemBuilder

func (*ItemBuilder) LinkedDatasetFieldID

func (b *ItemBuilder) LinkedDatasetFieldID(dfid *DatasetFieldID) *ItemBuilder

func (*ItemBuilder) LinkedDatasetID

func (b *ItemBuilder) LinkedDatasetID(did *DatasetID) *ItemBuilder

func (*ItemBuilder) LinkedDatasetSchemaID

func (b *ItemBuilder) LinkedDatasetSchemaID(dsid *DatasetSchemaID) *ItemBuilder

func (*ItemBuilder) MustBuild added in v0.5.0

func (b *ItemBuilder) MustBuild() *Item

func (*ItemBuilder) NewID

func (b *ItemBuilder) NewID() *ItemBuilder

func (*ItemBuilder) Parent added in v0.3.0

func (b *ItemBuilder) Parent(p *ID) *ItemBuilder

func (*ItemBuilder) Scene

func (b *ItemBuilder) Scene(sid SceneID) *ItemBuilder

type List

type List []Tag

func DerefList added in v0.5.0

func DerefList(tags []*Tag) List

func (List) FilterByScene added in v0.5.0

func (l List) FilterByScene(s SceneID) (res List)

func (List) Groups added in v0.5.0

func (l List) Groups() (res []*Group)

func (List) Items added in v0.5.0

func (l List) Items() (res []*Item)

func (List) Refs added in v0.5.0

func (l List) Refs() (res []*Tag)

func (List) Roots added in v0.5.0

func (l List) Roots() (res List)

type Loader added in v0.5.0

type Loader func(context.Context, ...ID) ([]*Tag, error)

func LoaderFrom added in v0.5.0

func LoaderFrom(data List) Loader

func LoaderFromMap added in v0.5.0

func LoaderFromMap(data map[ID]Tag) Loader

type Map added in v0.5.0

type Map map[ID]Tag

func MapFromList added in v0.5.0

func MapFromList(tags []Tag) Map

func MapFromRefList added in v0.5.0

func MapFromRefList(tags []*Tag) Map

func (Map) All added in v0.5.0

func (m Map) All() List

type SceneID added in v0.4.0

type SceneID = id.SceneID

type SceneLoader added in v0.5.0

type SceneLoader func(context.Context, SceneID) ([]*Tag, error)

func SceneLoaderFrom added in v0.5.0

func SceneLoaderFrom(data List) SceneLoader

type Tag

type Tag interface {
	ID() ID
	Scene() SceneID
	Label() string
	Rename(string)
}

Jump to

Keyboard shortcuts

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