Documentation
¶
Index ¶
- Variables
- type Edit
- func (s *Edit) Apply(ctx context.Context, input models.ApplyEditInput) (*models.Edit, error)
- func (s *Edit) ApplyEdit(ctx context.Context, editID uuid.UUID, immediate bool) (*models.Edit, error)
- func (s *Edit) Cancel(ctx context.Context, input models.CancelEditInput) (*models.Edit, error)
- func (s *Edit) CloseCompleted(ctx context.Context) ([]*models.Edit, error)
- func (s *Edit) CloseEdit(ctx context.Context, editID uuid.UUID, status models.VoteStatusEnum) (*models.Edit, error)
- func (s *Edit) CreateComment(ctx context.Context, input models.EditCommentInput) (*models.Edit, *models.EditComment, error)
- func (s *Edit) CreatePerformerEdit(ctx context.Context, input models.PerformerEditInput) (*models.Edit, error)
- func (s *Edit) CreateSceneEdit(ctx context.Context, input models.SceneEditInput) (*models.Edit, error)
- func (s *Edit) CreateStudioEdit(ctx context.Context, input models.StudioEditInput) (*models.Edit, error)
- func (s *Edit) CreateTagEdit(ctx context.Context, input models.TagEditInput) (*models.Edit, error)
- func (s *Edit) CreateVote(ctx context.Context, input models.EditVoteInput) (*models.Edit, error)
- func (s *Edit) Delete(ctx context.Context, id uuid.UUID) (bool, error)
- func (s *Edit) FindByID(ctx context.Context, id uuid.UUID) (*models.Edit, error)
- func (s *Edit) FindByPerformerID(ctx context.Context, performerID uuid.UUID) ([]models.Edit, error)
- func (s *Edit) FindBySceneID(ctx context.Context, sceneID uuid.UUID) ([]models.Edit, error)
- func (s *Edit) FindByStudioID(ctx context.Context, studioID uuid.UUID) ([]models.Edit, error)
- func (s *Edit) FindByTagID(ctx context.Context, tagID uuid.UUID) ([]models.Edit, error)
- func (s *Edit) FindPendingPerformerCreation(ctx context.Context, input models.QueryExistingPerformerInput) ([]models.Edit, error)
- func (s *Edit) FindPendingSceneCreation(ctx context.Context, input models.QueryExistingSceneInput) ([]models.Edit, error)
- func (s *Edit) GetComments(ctx context.Context, editID uuid.UUID) ([]models.EditComment, error)
- func (s *Edit) GetEditTarget(ctx context.Context, id uuid.UUID) (models.EditTarget, error)
- func (s *Edit) GetMergeSources(ctx context.Context, mergeIDs []uuid.UUID, targetType string) ([]models.EditTarget, error)
- func (s *Edit) GetMergedImages(ctx context.Context, id uuid.UUID) ([]models.Image, error)
- func (s *Edit) GetMergedPerformerAliases(ctx context.Context, id uuid.UUID) ([]string, error)
- func (s *Edit) GetMergedPerformerPiercings(ctx context.Context, id uuid.UUID) ([]models.BodyModification, error)
- func (s *Edit) GetMergedPerformerTattoos(ctx context.Context, id uuid.UUID) ([]models.BodyModification, error)
- func (s *Edit) GetMergedPerformers(ctx context.Context, id uuid.UUID) ([]models.PerformerAppearance, error)
- func (s *Edit) GetMergedStudioAliases(ctx context.Context, id uuid.UUID) ([]string, error)
- func (s *Edit) GetMergedTags(ctx context.Context, id uuid.UUID) ([]models.Tag, error)
- func (s *Edit) GetMergedURLs(ctx context.Context, id uuid.UUID) ([]models.URL, error)
- func (s *Edit) GetVotes(ctx context.Context, editID uuid.UUID) ([]models.EditVote, error)
- func (s *Edit) LoadCommentsByIds(ctx context.Context, ids []uuid.UUID) ([]*models.EditComment, []error)
- func (s *Edit) LoadIds(ctx context.Context, ids []uuid.UUID) ([]*models.Edit, []error)
- func (s *Edit) PromoteUserVoteRights(ctx context.Context, userID uuid.UUID, threshold int) error
- func (s *Edit) QueryCount(ctx context.Context, filter models.EditQueryInput) (int, error)
- func (s *Edit) QueryEdits(ctx context.Context, filter models.EditQueryInput) ([]models.Edit, error)
- func (s *Edit) ResolveVotingThreshold(ctx context.Context, edit *models.Edit) (models.VoteStatusEnum, error)
- func (s *Edit) UpdatePerformerEdit(ctx context.Context, id uuid.UUID, input models.PerformerEditInput) (*models.Edit, error)
- func (s *Edit) UpdateSceneEdit(ctx context.Context, id uuid.UUID, input models.SceneEditInput) (*models.Edit, error)
- func (s *Edit) UpdateStudioEdit(ctx context.Context, id uuid.UUID, input models.StudioEditInput) (*models.Edit, error)
- func (s *Edit) UpdateTagEdit(ctx context.Context, id uuid.UUID, input models.TagEditInput) (*models.Edit, error)
- type InputSpecifiedFunc
- type PerformerEditProcessor
- func (m *PerformerEditProcessor) ApplyEdit(performer *models.Performer, create bool, data *models.PerformerEditData) error
- func (m *PerformerEditProcessor) CreateComment(user *models.User, comment *string) error
- func (m *PerformerEditProcessor) CreateEdit() (*models.Edit, error)
- func (m *PerformerEditProcessor) CreateJoin(input models.PerformerEditInput) error
- func (m *PerformerEditProcessor) Edit(input models.PerformerEditInput, inputArgs utils.ArgumentsQuery, update bool) error
- func (m *PerformerEditProcessor) MergeInto(source *models.Performer, target *models.Performer, setAliases bool) error
- func (m *PerformerEditProcessor) SoftDelete(performer models.Performer) (*models.Performer, error)
- func (m *PerformerEditProcessor) UpdateEdit() (*models.Edit, error)
- func (m *PerformerEditProcessor) UpdateScenePerformerAlias(performerID uuid.UUID, oldName string, newName string) error
- func (m *PerformerEditProcessor) UpdateScenePerformers(oldPerformer *models.Performer, newTarget *models.Performer, setAliases bool) error
- type SceneEditProcessor
- func (m *SceneEditProcessor) ApplyEdit(scene *models.Scene, create bool, data *models.SceneEditData, ...) error
- func (m *SceneEditProcessor) CreateComment(user *models.User, comment *string) error
- func (m *SceneEditProcessor) CreateEdit() (*models.Edit, error)
- func (m *SceneEditProcessor) CreateJoin(input models.SceneEditInput) error
- func (m *SceneEditProcessor) Edit(input models.SceneEditInput, inputArgs utils.ArgumentsQuery, update bool) error
- func (m *SceneEditProcessor) MergeInto(source queries.Scene, target queries.Scene) error
- func (m *SceneEditProcessor) UpdateEdit() (*models.Edit, error)
- type StudioEditProcessor
- func (m *StudioEditProcessor) CreateComment(user *models.User, comment *string) error
- func (m *StudioEditProcessor) CreateEdit() (*models.Edit, error)
- func (m *StudioEditProcessor) CreateJoin(input models.StudioEditInput) error
- func (m *StudioEditProcessor) Edit(input models.StudioEditInput, inputArgs utils.ArgumentsQuery) error
- func (m *StudioEditProcessor) UpdateEdit() (*models.Edit, error)
- type TagEditProcessor
- func (m *TagEditProcessor) CreateComment(user *models.User, comment *string) error
- func (m *TagEditProcessor) CreateEdit() (*models.Edit, error)
- func (m *TagEditProcessor) CreateJoin(input models.TagEditInput) error
- func (m *TagEditProcessor) Edit(input models.TagEditInput, inputArgs utils.ArgumentsQuery) error
- func (m *TagEditProcessor) UpdateEdit() (*models.Edit, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosedEdit = fmt.Errorf("votes can only be cast on pending edits")
View Source
var ErrEditAlreadyApplied = errors.New("edit already applied")
View Source
var ErrEditNotFound = errors.New("edit not found")
View Source
var ErrEntityDeleted = errors.New("entity is deleted")
View Source
var ErrEntityNotFound = errors.New("entity not found")
View Source
var ErrInvalidDraft = errors.New("invalid draft id")
View Source
var ErrInvalidImage = errors.New("invalid image id")
View Source
var ErrInvalidPerformer = errors.New("invalid performer id")
View Source
var ErrInvalidSite = errors.New("invalid url site id")
View Source
var ErrInvalidStudio = errors.New("invalid studio id")
View Source
var ErrInvalidTag = errors.New("invalid tag id")
View Source
var ErrInvalidVoteStatus = errors.New("invalid vote status")
View Source
var ErrMergeIDMissing = errors.New("merge target ID is required")
View Source
var ErrMergeTargetIsSource = errors.New("merge target cannot be used as source")
View Source
var ErrNoChanges = errors.New("edit contains no changes")
View Source
var ErrNoMergeSources = errors.New("no merge sources found")
View Source
var ErrSceneDraftRequired = fmt.Errorf("scenes have to be submitted through drafts")
View Source
var ErrUpdateLimit = fmt.Errorf("edit update limit reached")
Functions ¶
This section is empty.
Types ¶
type Edit ¶
type Edit struct {
// contains filtered or unexported fields
}
Edit handles edit-related operations
func NewEdit ¶
func NewEdit(queries *queries.Queries, withTxn queries.WithTxnFunc) *Edit
NewEdit creates a new edit service
func (*Edit) CloseCompleted ¶
func (*Edit) CreateComment ¶
func (s *Edit) CreateComment(ctx context.Context, input models.EditCommentInput) (*models.Edit, *models.EditComment, error)
func (*Edit) CreatePerformerEdit ¶
func (*Edit) CreateSceneEdit ¶
func (*Edit) CreateStudioEdit ¶
func (*Edit) CreateTagEdit ¶
func (*Edit) CreateVote ¶
func (*Edit) FindByPerformerID ¶
func (*Edit) FindBySceneID ¶
func (*Edit) FindByStudioID ¶
func (*Edit) FindByTagID ¶
func (*Edit) FindPendingPerformerCreation ¶
func (*Edit) FindPendingSceneCreation ¶
func (*Edit) GetComments ¶
func (*Edit) GetEditTarget ¶
func (*Edit) GetMergeSources ¶
func (*Edit) GetMergedImages ¶
func (*Edit) GetMergedPerformerAliases ¶
func (*Edit) GetMergedPerformerPiercings ¶
func (*Edit) GetMergedPerformerTattoos ¶
func (*Edit) GetMergedPerformers ¶
func (*Edit) GetMergedStudioAliases ¶
func (*Edit) GetMergedTags ¶
func (*Edit) GetMergedURLs ¶
func (*Edit) LoadCommentsByIds ¶
func (*Edit) PromoteUserVoteRights ¶
func (*Edit) QueryCount ¶
func (*Edit) QueryEdits ¶
func (*Edit) ResolveVotingThreshold ¶
func (*Edit) UpdatePerformerEdit ¶
func (*Edit) UpdateSceneEdit ¶
func (*Edit) UpdateStudioEdit ¶
type InputSpecifiedFunc ¶
InputSpecifiedFunc is function that returns true if the qualified field name was specified in the input. Used to distinguish between nil/empty fields and unspecified fields
type PerformerEditProcessor ¶
type PerformerEditProcessor struct {
// contains filtered or unexported fields
}
func (*PerformerEditProcessor) ApplyEdit ¶
func (m *PerformerEditProcessor) ApplyEdit(performer *models.Performer, create bool, data *models.PerformerEditData) error
func (*PerformerEditProcessor) CreateComment ¶
func (*PerformerEditProcessor) CreateEdit ¶
func (*PerformerEditProcessor) CreateJoin ¶
func (m *PerformerEditProcessor) CreateJoin(input models.PerformerEditInput) error
func (*PerformerEditProcessor) Edit ¶
func (m *PerformerEditProcessor) Edit(input models.PerformerEditInput, inputArgs utils.ArgumentsQuery, update bool) error
func (*PerformerEditProcessor) SoftDelete ¶
func (*PerformerEditProcessor) UpdateEdit ¶
func (*PerformerEditProcessor) UpdateScenePerformerAlias ¶
func (*PerformerEditProcessor) UpdateScenePerformers ¶
type SceneEditProcessor ¶
type SceneEditProcessor struct {
// contains filtered or unexported fields
}
func (*SceneEditProcessor) ApplyEdit ¶
func (m *SceneEditProcessor) ApplyEdit(scene *models.Scene, create bool, data *models.SceneEditData, userID *uuid.UUID) error
func (*SceneEditProcessor) CreateComment ¶
func (*SceneEditProcessor) CreateEdit ¶
func (*SceneEditProcessor) CreateJoin ¶
func (m *SceneEditProcessor) CreateJoin(input models.SceneEditInput) error
func (*SceneEditProcessor) Edit ¶
func (m *SceneEditProcessor) Edit(input models.SceneEditInput, inputArgs utils.ArgumentsQuery, update bool) error
func (*SceneEditProcessor) UpdateEdit ¶
type StudioEditProcessor ¶
type StudioEditProcessor struct {
// contains filtered or unexported fields
}
func (*StudioEditProcessor) CreateComment ¶
func (*StudioEditProcessor) CreateEdit ¶
func (*StudioEditProcessor) CreateJoin ¶
func (m *StudioEditProcessor) CreateJoin(input models.StudioEditInput) error
func (*StudioEditProcessor) Edit ¶
func (m *StudioEditProcessor) Edit(input models.StudioEditInput, inputArgs utils.ArgumentsQuery) error
func (*StudioEditProcessor) UpdateEdit ¶
type TagEditProcessor ¶
type TagEditProcessor struct {
// contains filtered or unexported fields
}
func (*TagEditProcessor) CreateComment ¶
func (*TagEditProcessor) CreateEdit ¶
func (*TagEditProcessor) CreateJoin ¶
func (m *TagEditProcessor) CreateJoin(input models.TagEditInput) error
func (*TagEditProcessor) Edit ¶
func (m *TagEditProcessor) Edit(input models.TagEditInput, inputArgs utils.ArgumentsQuery) error
func (*TagEditProcessor) UpdateEdit ¶
Click to show internal directories.
Click to hide internal directories.