tag

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByAlias added in v0.8.0

func ByAlias(qb models.TagReader, alias string) (*models.Tag, error)

func ByName added in v0.8.0

func ByName(qb models.TagReader, name string) (*models.Tag, error)

func EnsureAliasesUnique added in v0.8.0

func EnsureAliasesUnique(id int, aliases []string, qb models.TagReader) error

func EnsureTagNameUnique added in v0.8.0

func EnsureTagNameUnique(id int, name string, qb models.TagReader) error

EnsureTagNameUnique returns an error if the tag name provided is used as a name or alias of another existing tag.

func GetIDs

func GetIDs(tags []*models.Tag) []int

func GetNames

func GetNames(tags []*models.Tag) []string

func MergeHierarchy added in v0.10.0

func MergeHierarchy(destination int, sources []int, qb models.TagReader) ([]int, []int, error)

func ToJSON

func ToJSON(reader models.TagReader, tag *models.Tag) (*jsonschema.Tag, error)

ToJSON converts a Tag object into its JSON equivalent.

func ValidateHierarchy added in v0.11.0

func ValidateHierarchy(tag *models.Tag, parentIDs, childIDs []int, qb models.TagReader) error

Types

type Importer

type Importer struct {
	ReaderWriter        models.TagReaderWriter
	Input               jsonschema.Tag
	MissingRefBehaviour models.ImportMissingRefEnum
	// contains filtered or unexported fields
}

func (*Importer) Create

func (i *Importer) Create() (*int, error)

func (*Importer) FindExistingID

func (i *Importer) FindExistingID() (*int, error)

func (*Importer) Name

func (i *Importer) Name() string

func (*Importer) PostImport

func (i *Importer) PostImport(id int) error

func (*Importer) PreImport

func (i *Importer) PreImport() error

func (*Importer) Update

func (i *Importer) Update(id int) error

type InvalidTagHierarchyError added in v0.10.0

type InvalidTagHierarchyError struct {
	Direction       string
	CurrentRelation string
	InvalidTag      string
	ApplyingTag     string
	TagPath         string
}

func (*InvalidTagHierarchyError) Error added in v0.10.0

func (e *InvalidTagHierarchyError) Error() string

type NameExistsError added in v0.8.0

type NameExistsError struct {
	Name string
}

func (*NameExistsError) Error added in v0.8.0

func (e *NameExistsError) Error() string

type NameUsedByAliasError added in v0.8.0

type NameUsedByAliasError struct {
	Name     string
	OtherTag string
}

func (*NameUsedByAliasError) Error added in v0.8.0

func (e *NameUsedByAliasError) Error() string

type ParentTagNotExistError added in v0.10.0

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

func (ParentTagNotExistError) Error added in v0.10.0

func (e ParentTagNotExistError) Error() string

func (ParentTagNotExistError) MissingParent added in v0.10.0

func (e ParentTagNotExistError) MissingParent() string

Jump to

Keyboard shortcuts

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