Documentation ¶
Overview ¶
Package group provides the application logic for groups.
Index ¶
- Variables
- func CountByContainingGroupID(ctx context.Context, r models.GroupQueryer, id int, depth *int) (int, error)
- func CountByStudioID(ctx context.Context, r models.GroupQueryer, id int, depth *int) (int, error)
- func CountByTagID(ctx context.Context, r models.GroupQueryer, id int, depth *int) (int, error)
- func ToJSON(ctx context.Context, reader ImageGetter, studioReader models.StudioGetter, ...) (*jsonschema.Group, error)
- type AnscestorFinder
- type CreatorUpdater
- type ImageGetter
- type ImageInput
- 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 Service
- func (s *Service) AddSubGroups(ctx context.Context, groupID int, subGroups []models.GroupIDDescription, ...) error
- func (s *Service) Create(ctx context.Context, group *models.Group, frontimageData []byte, ...) error
- func (s *Service) RemoveSubGroups(ctx context.Context, groupID int, subGroupIDs []int) error
- func (s *Service) ReorderSubGroups(ctx context.Context, groupID int, subGroupIDs []int, insertPointID int, ...) error
- func (s *Service) UpdatePartial(ctx context.Context, id int, updatedGroup models.GroupPartial, ...) (*models.Group, error)
- type SubGroupAdder
- type SubGroupAlreadyInGroupError
- type SubGroupIDFinder
- type SubGroupNotExistError
- type SubGroupRemover
- type SubGroupReorderer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyName = errors.New("name cannot be empty") ErrHierarchyLoop = errors.New("a group cannot be contained by one of its subgroups") )
View Source
var ErrInvalidInsertIndex = errors.New("invalid insert index")
Functions ¶
func CountByStudioID ¶
func CountByTagID ¶
func ToJSON ¶
func ToJSON(ctx context.Context, reader ImageGetter, studioReader models.StudioGetter, movie *models.Group) (*jsonschema.Group, error)
ToJSON converts a Movie into its JSON equivalent.
Types ¶
type AnscestorFinder ¶
type CreatorUpdater ¶
type CreatorUpdater interface { models.GroupGetter models.GroupCreator models.GroupUpdater models.ContainingGroupLoader models.SubGroupLoader AnscestorFinder SubGroupIDFinder SubGroupAdder SubGroupRemover SubGroupReorderer }
type ImageGetter ¶
type ImageInput ¶
type Importer ¶
type Importer struct { ReaderWriter ImporterReaderWriter StudioWriter models.StudioFinderCreator TagWriter models.TagFinderCreator Input jsonschema.Group MissingRefBehaviour models.ImportMissingRefEnum // contains filtered or unexported fields }
func (*Importer) FindExistingID ¶
type ImporterReaderWriter ¶
type Service ¶
type Service struct {
Repository CreatorUpdater
}
func (*Service) AddSubGroups ¶
func (*Service) RemoveSubGroups ¶
func (*Service) ReorderSubGroups ¶
func (*Service) UpdatePartial ¶
func (s *Service) UpdatePartial(ctx context.Context, id int, updatedGroup models.GroupPartial, frontImage ImageInput, backImage ImageInput) (*models.Group, error)
type SubGroupAdder ¶
type SubGroupAlreadyInGroupError ¶
type SubGroupAlreadyInGroupError struct {
GroupIDs []int
}
func (*SubGroupAlreadyInGroupError) Error ¶
func (e *SubGroupAlreadyInGroupError) Error() string
type SubGroupIDFinder ¶
type SubGroupNotExistError ¶
type SubGroupNotExistError struct {
// contains filtered or unexported fields
}
func (SubGroupNotExistError) Error ¶
func (e SubGroupNotExistError) Error() string
func (SubGroupNotExistError) MissingSubGroup ¶
func (e SubGroupNotExistError) MissingSubGroup() string
type SubGroupRemover ¶
Click to show internal directories.
Click to hide internal directories.