Documentation
¶
Index ¶
- Variables
- func ByAlias(ctx context.Context, qb Queryer, alias string) (*models.Studio, error)
- func ByName(ctx context.Context, qb Queryer, name string) (*models.Studio, error)
- func EnsureAliasesUnique(ctx context.Context, id int, aliases []string, qb Queryer) error
- func EnsureStudioNameUnique(ctx context.Context, id int, name string, qb Queryer) error
- func ToJSON(ctx context.Context, reader FinderImageAliasStashIDGetter, ...) (*jsonschema.Studio, error)
- func ValidateModify(ctx context.Context, s models.StudioPartial, qb FinderQueryer) error
- type Finder
- type FinderImageAliasStashIDGetter
- type FinderQueryer
- 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 NameExistsError
- type NameFinderCreator
- type NameFinderCreatorUpdater
- type NameUsedByAliasError
- type Queryer
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrParentStudioNotExist = errors.New("parent studio does not exist")
View Source
var (
ErrStudioOwnAncestor = errors.New("studio cannot be an ancestor of itself")
)
Functions ¶
func EnsureAliasesUnique ¶ added in v0.10.0
func EnsureStudioNameUnique ¶ added in v0.10.0
EnsureStudioNameUnique returns an error if the studio name provided is used as a name or alias of another existing tag.
func ToJSON ¶
func ToJSON(ctx context.Context, reader FinderImageAliasStashIDGetter, studio *models.Studio) (*jsonschema.Studio, error)
ToJSON converts a Studio object into its JSON equivalent.
func ValidateModify ¶ added in v0.22.0
func ValidateModify(ctx context.Context, s models.StudioPartial, qb FinderQueryer) error
Checks to make sure that: 1. The studio exists locally 2. The studio is not its own ancestor 3. The studio's aliases are unique
Types ¶
type FinderImageAliasStashIDGetter ¶ added in v0.22.0
type FinderImageAliasStashIDGetter interface {
Finder
GetImage(ctx context.Context, studioID int) ([]byte, error)
models.AliasLoader
models.StashIDLoader
}
type FinderQueryer ¶ added in v0.22.0
type FinderQueryer interface {
Finder
Queryer
models.AliasLoader
}
type Importer ¶
type Importer struct {
ReaderWriter NameFinderCreatorUpdater
Input jsonschema.Studio
MissingRefBehaviour models.ImportMissingRefEnum
ID int
// contains filtered or unexported fields
}
func (*Importer) FindExistingID ¶
type NameExistsError ¶ added in v0.10.0
type NameExistsError struct {
Name string
}
func (*NameExistsError) Error ¶ added in v0.10.0
func (e *NameExistsError) Error() string
type NameFinderCreator ¶ added in v0.17.0
type NameFinderCreatorUpdater ¶ added in v0.17.0
type NameUsedByAliasError ¶ added in v0.10.0
func (*NameUsedByAliasError) Error ¶ added in v0.10.0
func (e *NameUsedByAliasError) Error() string
Click to show internal directories.
Click to hide internal directories.