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 CountByContainingGroupID ¶
func CountByContainingGroupID(ctx context.Context, r models.GroupQueryer, id int, depth *int) (int, error)
func CountByStudioID ¶
func CountByStudioID(ctx context.Context, r models.GroupQueryer, id int, depth *int) (int, error)
func CountByTagID ¶
func CountByTagID(ctx context.Context, r models.GroupQueryer, id int, depth *int) (int, error)
Types ¶
type AnscestorFinder ¶
type AnscestorFinder interface {
FindInAncestors(ctx context.Context, ascestorIDs []int, ids []int) ([]int, error)
}
type CreatorUpdater ¶
type CreatorUpdater interface {
models.GroupGetter
models.GroupCreator
models.GroupUpdater
models.ContainingGroupLoader
models.SubGroupLoader
AnscestorFinder
SubGroupIDFinder
SubGroupAdder
SubGroupRemover
SubGroupReorderer
}
type ImageGetter ¶
type ImageGetter interface {
GetFrontImage(ctx context.Context, movieID int) ([]byte, error)
GetBackImage(ctx context.Context, movieID int) ([]byte, error)
}
type ImageInput ¶
type ImageInput struct {
Image []byte
Set bool
}
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 ¶
func (i *Importer) FindExistingID(ctx context.Context) (*int, error)
func (*Importer) PostImport ¶
func (i *Importer) PostImport(ctx context.Context, id int) error
type ImporterReaderWriter ¶
type ImporterReaderWriter interface {
models.GroupCreatorUpdater
FindByName(ctx context.Context, name string, nocase bool) (*models.Group, error)
}
type Service ¶
type Service struct {
Repository CreatorUpdater
}
func (*Service) AddSubGroups ¶
func (s *Service) AddSubGroups(ctx context.Context, groupID int, subGroups []models.GroupIDDescription, insertIndex *int) error
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, group *models.Group, frontimageData []byte, backimageData []byte) error
func (*Service) RemoveSubGroups ¶
func (s *Service) RemoveSubGroups(ctx context.Context, groupID int, subGroupIDs []int) error
func (*Service) ReorderSubGroups ¶
func (s *Service) ReorderSubGroups(ctx context.Context, groupID int, subGroupIDs []int, insertPointID int, insertAfter bool) error
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 SubGroupAdder interface {
AddSubGroups(ctx context.Context, groupID int, subGroups []models.GroupIDDescription, insertIndex *int) error
}
type SubGroupAlreadyInGroupError ¶
type SubGroupAlreadyInGroupError struct {
GroupIDs []int
}
type SubGroupIDFinder ¶
type SubGroupIDFinder interface {
FindSubGroupIDs(ctx context.Context, containingID int, ids []int) ([]int, error)
}
type SubGroupNotExistError ¶
type SubGroupNotExistError struct {
// contains filtered or unexported fields
}
func (SubGroupNotExistError) MissingSubGroup ¶
func (e SubGroupNotExistError) MissingSubGroup() string
type SubGroupRemover ¶
type SubGroupRemover interface {
RemoveSubGroups(ctx context.Context, groupID int, subGroupIDs []int) error
}
type SubGroupReorderer ¶
type SubGroupReorderer interface {
ReorderSubGroups(ctx context.Context, groupID int, subGroupIDs []int, insertID int, insertAfter bool) error
}
Click to show internal directories.
Click to hide internal directories.