Documentation ¶
Index ¶
- func ByAlias(ctx context.Context, qb Queryer, alias string) (*models.Tag, error)
- func ByName(ctx context.Context, qb Queryer, name string) (*models.Tag, error)
- func EnsureAliasesUnique(ctx context.Context, id int, aliases []string, qb Queryer) error
- func EnsureTagNameUnique(ctx context.Context, id int, name string, qb Queryer) error
- func GetIDs(tags []*models.Tag) []int
- func GetNames(tags []*models.Tag) []string
- func MergeHierarchy(ctx context.Context, destination int, sources []int, qb RelationshipGetter) ([]int, []int, error)
- func ToJSON(ctx context.Context, reader FinderAliasImageGetter, tag *models.Tag) (*jsonschema.Tag, error)
- func ValidateHierarchy(ctx context.Context, tag *models.Tag, parentIDs, childIDs []int, ...) error
- type Finder
- type FinderAliasImageGetter
- type Importer
- func (i *Importer) Create(ctx context.Context) (*int, error)
- func (i *Importer) FindExistingID(ctx context.Context) (*int, error)
- func (i *Importer) Name() string
- func (i *Importer) PostImport(ctx context.Context, id int) error
- func (i *Importer) PreImport(ctx context.Context) error
- func (i *Importer) Update(ctx context.Context, id int) error
- type InvalidTagHierarchyError
- type NameExistsError
- type NameFinderCreator
- type NameFinderCreatorUpdater
- type NameUsedByAliasError
- type ParentTagNotExistError
- type Queryer
- type RelationshipGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureAliasesUnique ¶ added in v0.8.0
func EnsureTagNameUnique ¶ added in v0.8.0
EnsureTagNameUnique returns an error if the tag name provided is used as a name or alias of another existing tag.
func MergeHierarchy ¶ added in v0.10.0
func ToJSON ¶
func ToJSON(ctx context.Context, reader FinderAliasImageGetter, tag *models.Tag) (*jsonschema.Tag, error)
ToJSON converts a Tag object into its JSON equivalent.
func ValidateHierarchy ¶ added in v0.11.0
Types ¶
type FinderAliasImageGetter ¶ added in v0.17.0
type Importer ¶
type Importer struct { ReaderWriter NameFinderCreatorUpdater Input jsonschema.Tag MissingRefBehaviour models.ImportMissingRefEnum // contains filtered or unexported fields }
func (*Importer) FindExistingID ¶
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 NameFinderCreator ¶ added in v0.17.0
type NameFinderCreatorUpdater ¶ added in v0.17.0
type NameFinderCreatorUpdater interface { FindByName(ctx context.Context, name string, nocase bool) (*models.Tag, error) Create(ctx context.Context, newTag models.Tag) (*models.Tag, error) UpdateFull(ctx context.Context, updatedTag models.Tag) (*models.Tag, error) UpdateImage(ctx context.Context, tagID int, image []byte) error UpdateAliases(ctx context.Context, tagID int, aliases []string) error UpdateParentTags(ctx context.Context, tagID int, parentIDs []int) error }
type NameUsedByAliasError ¶ added in v0.8.0
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
type Queryer ¶ added in v0.17.0
type Queryer interface {
Query(ctx context.Context, tagFilter *models.TagFilterType, findFilter *models.FindFilterType) ([]*models.Tag, int, error)
}
type RelationshipGetter ¶ added in v0.17.0
type RelationshipGetter interface { FindAllAncestors(ctx context.Context, tagID int, excludeIDs []int) ([]*models.TagPath, error) FindAllDescendants(ctx context.Context, tagID int, excludeIDs []int) ([]*models.TagPath, error) FindByChildTagID(ctx context.Context, childID int) ([]*models.Tag, error) FindByParentTagID(ctx context.Context, parentID int) ([]*models.Tag, error) }
Click to show internal directories.
Click to hide internal directories.