Documentation
¶
Overview ¶
Package tag provides application logic for tag objects.
Index ¶
- Variables
- func ByAlias(ctx context.Context, qb models.TagQueryer, alias string) (*models.Tag, error)
- func ByName(ctx context.Context, qb models.TagQueryer, name string) (*models.Tag, error)
- func EnsureAliasesUnique(ctx context.Context, id int, aliases []string, qb models.TagQueryer) error
- func EnsureTagNameUnique(ctx context.Context, id int, name string, qb models.TagQueryer) error
- func GetIDs(tags []*models.Tag) []int
- func GetNames(tags []*models.Tag) []string
- func MergeHierarchy(ctx context.Context, destination int, sources []int, qb RelationshipFinder) ([]int, []int, error)
- func ToJSON(ctx context.Context, reader FinderAliasImageGetter, tag *models.Tag) (*jsonschema.Tag, error)
- func ValidateCreate(ctx context.Context, tag models.Tag, qb models.TagReader) error
- func ValidateHierarchyExisting(ctx context.Context, tag *models.Tag, parentIDs, childIDs []int, ...) error
- func ValidateHierarchyNew(ctx context.Context, parentIDs, childIDs []int, qb RelationshipFinder) error
- func ValidateUpdate(ctx context.Context, id int, partial models.TagPartial, qb models.TagReader) error
- 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 ImporterReaderWriter
- type InvalidTagHierarchyError
- type NameExistsError
- type NameUsedByAliasError
- type NotFoundError
- type ParentTagNotExistError
- type RelationshipFinder
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNameMissing = errors.New("tag name must not be blank")
)
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 ValidateCreate ¶ added in v0.27.0
func ValidateHierarchyExisting ¶ added in v0.27.0
func ValidateHierarchyNew ¶ added in v0.27.0
func ValidateHierarchyNew(ctx context.Context, parentIDs, childIDs []int, qb RelationshipFinder) error
func ValidateUpdate ¶ added in v0.27.0
Types ¶
type FinderAliasImageGetter ¶ added in v0.17.0
type Importer ¶
type Importer struct { ReaderWriter ImporterReaderWriter Input jsonschema.Tag MissingRefBehaviour models.ImportMissingRefEnum // contains filtered or unexported fields }
func (*Importer) FindExistingID ¶
type ImporterReaderWriter ¶ added in v0.23.0
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
func (*NameUsedByAliasError) Error ¶ added in v0.8.0
func (e *NameUsedByAliasError) Error() string
type NotFoundError ¶ added in v0.27.0
type NotFoundError struct {
// contains filtered or unexported fields
}
func (*NotFoundError) Error ¶ added in v0.27.0
func (e *NotFoundError) 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
Click to show internal directories.
Click to hide internal directories.