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 FinderImageStashIDGetter, studio *models.Studio) (*jsonschema.Studio, error)
- type Finder
- type FinderImageStashIDGetter
- 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")
Functions ¶
func ByAlias ¶ added in v0.10.0
func ByAlias(ctx context.Context, qb Queryer, alias string) (*models.Studio, error)
func ByName ¶ added in v0.10.0
func ByName(ctx context.Context, qb Queryer, name string) (*models.Studio, error)
func EnsureAliasesUnique ¶ added in v0.10.0
func EnsureAliasesUnique(ctx context.Context, id int, aliases []string, qb Queryer) error
func EnsureStudioNameUnique ¶ added in v0.10.0
func EnsureStudioNameUnique(ctx context.Context, id int, name string, qb Queryer) error
EnsureStudioNameUnique returns an error if the studio name provided is used as a name or alias of another existing tag.
Types ¶
type Finder ¶ added in v0.17.0
type Finder interface {
Find(ctx context.Context, id int) (*models.Studio, error)
}
type FinderImageStashIDGetter ¶ added in v0.17.0
type FinderImageStashIDGetter interface {
Finder
GetAliases(ctx context.Context, studioID int) ([]string, error)
GetImage(ctx context.Context, studioID int) ([]byte, error)
models.StashIDLoader
}
type Importer ¶
type Importer struct {
ReaderWriter NameFinderCreatorUpdater
Input jsonschema.Studio
MissingRefBehaviour models.ImportMissingRefEnum
// contains filtered or unexported fields
}
func (*Importer) FindExistingID ¶
func (i *Importer) FindExistingID(ctx context.Context) (*int, error)
func (*Importer) PostImport ¶
func (i *Importer) PostImport(ctx context.Context, id int) error
type NameExistsError ¶ added in v0.10.0
type NameExistsError struct {
Name string
}
type NameFinderCreator ¶ added in v0.17.0
type NameFinderCreator interface {
FindByName(ctx context.Context, name string, nocase bool) (*models.Studio, error)
Create(ctx context.Context, newStudio models.Studio) (*models.Studio, error)
}
type NameFinderCreatorUpdater ¶ added in v0.17.0
type NameFinderCreatorUpdater interface {
FindByName(ctx context.Context, name string, nocase bool) (*models.Studio, error)
Create(ctx context.Context, newStudio models.Studio) (*models.Studio, error)
UpdateFull(ctx context.Context, updatedStudio models.Studio) (*models.Studio, error)
UpdateImage(ctx context.Context, studioID int, image []byte) error
UpdateAliases(ctx context.Context, studioID int, aliases []string) error
UpdateStashIDs(ctx context.Context, studioID int, stashIDs []models.StashID) error
}
type NameUsedByAliasError ¶ added in v0.10.0
type NameUsedByAliasError struct {
Name string
OtherStudio string
}
Click to show internal directories.
Click to hide internal directories.