models

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PendingActivationTypeNewUser       = "newUser"
	PendingActivationTypeResetPassword = "resetPassword"
)

Variables

View Source
var ErrInvalidDate = fmt.Errorf("invalid fuzzy date")

Functions

func CopyFull

func CopyFull(target interface{}, source interface{})

func MarshalID added in v0.1.0

func MarshalID(id uuid.UUID) graphql.Marshaler

Creates a marshaller which converts a uuid to a string

func NewExecutableSchema added in v0.1.0

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

func UnmarshalID added in v0.1.0

func UnmarshalID(v interface{}) (uuid.UUID, error)

Unmarshalls a string to a uuid

func ValidateFuzzyString added in v0.2.0

func ValidateFuzzyString(date *string) error

Types

type ActivateNewUserInput added in v0.1.0

type ActivateNewUserInput struct {
	Name          string `json:"name"`
	Email         string `json:"email"`
	ActivationKey string `json:"activation_key"`
	Password      string `json:"password"`
}

type ApplyEditInput added in v0.1.0

type ApplyEditInput struct {
	ID uuid.UUID `json:"id"`
}

type BodyModification

type BodyModification struct {
	Location    string  `json:"location"`
	Description *string `json:"description"`
}

type BodyModificationCriterionInput added in v0.1.0

type BodyModificationCriterionInput struct {
	Location    *string           `json:"location,omitempty"`
	Description *string           `json:"description,omitempty"`
	Modifier    CriterionModifier `json:"modifier"`
}

type BodyModificationInput

type BodyModificationInput = BodyModification

type BreastTypeCriterionInput added in v0.1.0

type BreastTypeCriterionInput struct {
	Value    *BreastTypeEnum   `json:"value,omitempty"`
	Modifier CriterionModifier `json:"modifier"`
}

type BreastTypeEnum added in v0.1.0

type BreastTypeEnum string
const (
	BreastTypeEnumNatural BreastTypeEnum = "NATURAL"
	BreastTypeEnumFake    BreastTypeEnum = "FAKE"
	BreastTypeEnumNa      BreastTypeEnum = "NA"
)

func (BreastTypeEnum) IsValid added in v0.1.0

func (e BreastTypeEnum) IsValid() bool

func (BreastTypeEnum) MarshalGQL added in v0.1.0

func (e BreastTypeEnum) MarshalGQL(w io.Writer)

func (BreastTypeEnum) String added in v0.1.0

func (e BreastTypeEnum) String() string

func (*BreastTypeEnum) UnmarshalGQL added in v0.1.0

func (e *BreastTypeEnum) UnmarshalGQL(v interface{}) error

type CancelEditInput added in v0.1.0

type CancelEditInput struct {
	ID uuid.UUID `json:"id"`
}

type ComplexityRoot added in v0.1.0

type ComplexityRoot struct {
	BodyModification struct {
		Description func(childComplexity int) int
		Location    func(childComplexity int) int
	}

	Draft struct {
		Created func(childComplexity int) int
		Data    func(childComplexity int) int
		Expires func(childComplexity int) int
		ID      func(childComplexity int) int
	}

	DraftEntity struct {
		ID   func(childComplexity int) int
		Name func(childComplexity int) int
	}

	DraftFingerprint struct {
		Algorithm func(childComplexity int) int
		Duration  func(childComplexity int) int
		Hash      func(childComplexity int) int
	}

	DraftSubmissionStatus struct {
		ID func(childComplexity int) int
	}

	Edit struct {
		Applied      func(childComplexity int) int
		Bot          func(childComplexity int) int
		Closed       func(childComplexity int) int
		Comments     func(childComplexity int) int
		Created      func(childComplexity int) int
		Destructive  func(childComplexity int) int
		Details      func(childComplexity int) int
		Expires      func(childComplexity int) int
		ID           func(childComplexity int) int
		MergeSources func(childComplexity int) int
		OldDetails   func(childComplexity int) int
		Operation    func(childComplexity int) int
		Options      func(childComplexity int) int
		Status       func(childComplexity int) int
		Target       func(childComplexity int) int
		TargetType   func(childComplexity int) int
		Updated      func(childComplexity int) int
		User         func(childComplexity int) int
		VoteCount    func(childComplexity int) int
		Votes        func(childComplexity int) int
	}

	EditComment struct {
		Comment func(childComplexity int) int
		Date    func(childComplexity int) int
		ID      func(childComplexity int) int
		User    func(childComplexity int) int
	}

	EditVote struct {
		Date func(childComplexity int) int
		User func(childComplexity int) int
		Vote func(childComplexity int) int
	}

	Fingerprint struct {
		Algorithm     func(childComplexity int) int
		Created       func(childComplexity int) int
		Duration      func(childComplexity int) int
		Hash          func(childComplexity int) int
		Submissions   func(childComplexity int) int
		Updated       func(childComplexity int) int
		UserSubmitted func(childComplexity int) int
	}

	FuzzyDate struct {
		Accuracy func(childComplexity int) int
		Date     func(childComplexity int) int
	}

	Image struct {
		Height func(childComplexity int) int
		ID     func(childComplexity int) int
		URL    func(childComplexity int) int
		Width  func(childComplexity int) int
	}

	InviteKey struct {
		Expires func(childComplexity int) int
		ID      func(childComplexity int) int
		Uses    func(childComplexity int) int
	}

	Measurements struct {
		BandSize func(childComplexity int) int
		CupSize  func(childComplexity int) int
		Hip      func(childComplexity int) int
		Waist    func(childComplexity int) int
	}

	Mutation struct {
		ActivateNewUser      func(childComplexity int, input ActivateNewUserInput) int
		ApplyEdit            func(childComplexity int, input ApplyEditInput) int
		CancelEdit           func(childComplexity int, input CancelEditInput) int
		ChangePassword       func(childComplexity int, input UserChangePasswordInput) int
		DestroyDraft         func(childComplexity int, id uuid.UUID) int
		EditComment          func(childComplexity int, input EditCommentInput) int
		EditVote             func(childComplexity int, input EditVoteInput) int
		FavoritePerformer    func(childComplexity int, id uuid.UUID, favorite bool) int
		FavoriteStudio       func(childComplexity int, id uuid.UUID, favorite bool) int
		GenerateInviteCode   func(childComplexity int) int
		GenerateInviteCodes  func(childComplexity int, input *GenerateInviteCodeInput) int
		GrantInvite          func(childComplexity int, input GrantInviteInput) int
		ImageCreate          func(childComplexity int, input ImageCreateInput) int
		ImageDestroy         func(childComplexity int, input ImageDestroyInput) int
		NewUser              func(childComplexity int, input NewUserInput) int
		PerformerCreate      func(childComplexity int, input PerformerCreateInput) int
		PerformerDestroy     func(childComplexity int, input PerformerDestroyInput) int
		PerformerEdit        func(childComplexity int, input PerformerEditInput) int
		PerformerEditUpdate  func(childComplexity int, id uuid.UUID, input PerformerEditInput) int
		PerformerUpdate      func(childComplexity int, input PerformerUpdateInput) int
		RegenerateAPIKey     func(childComplexity int, userID *uuid.UUID) int
		RescindInviteCode    func(childComplexity int, code uuid.UUID) int
		ResetPassword        func(childComplexity int, input ResetPasswordInput) int
		RevokeInvite         func(childComplexity int, input RevokeInviteInput) int
		SceneCreate          func(childComplexity int, input SceneCreateInput) int
		SceneDestroy         func(childComplexity int, input SceneDestroyInput) int
		SceneEdit            func(childComplexity int, input SceneEditInput) int
		SceneEditUpdate      func(childComplexity int, id uuid.UUID, input SceneEditInput) int
		SceneUpdate          func(childComplexity int, input SceneUpdateInput) int
		SiteCreate           func(childComplexity int, input SiteCreateInput) int
		SiteDestroy          func(childComplexity int, input SiteDestroyInput) int
		SiteUpdate           func(childComplexity int, input SiteUpdateInput) int
		StudioCreate         func(childComplexity int, input StudioCreateInput) int
		StudioDestroy        func(childComplexity int, input StudioDestroyInput) int
		StudioEdit           func(childComplexity int, input StudioEditInput) int
		StudioEditUpdate     func(childComplexity int, id uuid.UUID, input StudioEditInput) int
		StudioUpdate         func(childComplexity int, input StudioUpdateInput) int
		SubmitFingerprint    func(childComplexity int, input FingerprintSubmission) int
		SubmitPerformerDraft func(childComplexity int, input PerformerDraftInput) int
		SubmitSceneDraft     func(childComplexity int, input SceneDraftInput) int
		TagCategoryCreate    func(childComplexity int, input TagCategoryCreateInput) int
		TagCategoryDestroy   func(childComplexity int, input TagCategoryDestroyInput) int
		TagCategoryUpdate    func(childComplexity int, input TagCategoryUpdateInput) int
		TagCreate            func(childComplexity int, input TagCreateInput) int
		TagDestroy           func(childComplexity int, input TagDestroyInput) int
		TagEdit              func(childComplexity int, input TagEditInput) int
		TagEditUpdate        func(childComplexity int, id uuid.UUID, input TagEditInput) int
		TagUpdate            func(childComplexity int, input TagUpdateInput) int
		UserCreate           func(childComplexity int, input UserCreateInput) int
		UserDestroy          func(childComplexity int, input UserDestroyInput) int
		UserUpdate           func(childComplexity int, input UserUpdateInput) int
	}

	Performer struct {
		Age             func(childComplexity int) int
		Aliases         func(childComplexity int) int
		BandSize        func(childComplexity int) int
		BirthDate       func(childComplexity int) int
		Birthdate       func(childComplexity int) int
		BreastType      func(childComplexity int) int
		CareerEndYear   func(childComplexity int) int
		CareerStartYear func(childComplexity int) int
		Country         func(childComplexity int) int
		Created         func(childComplexity int) int
		CupSize         func(childComplexity int) int
		Deleted         func(childComplexity int) int
		Disambiguation  func(childComplexity int) int
		Edits           func(childComplexity int) int
		Ethnicity       func(childComplexity int) int
		EyeColor        func(childComplexity int) int
		Gender          func(childComplexity int) int
		HairColor       func(childComplexity int) int
		Height          func(childComplexity int) int
		HipSize         func(childComplexity int) int
		ID              func(childComplexity int) int
		Images          func(childComplexity int) int
		IsFavorite      func(childComplexity int) int
		Measurements    func(childComplexity int) int
		MergedIds       func(childComplexity int) int
		Name            func(childComplexity int) int
		Piercings       func(childComplexity int) int
		SceneCount      func(childComplexity int) int
		Scenes          func(childComplexity int, input *PerformerScenesInput) int
		Studios         func(childComplexity int) int
		Tattoos         func(childComplexity int) int
		Updated         func(childComplexity int) int
		Urls            func(childComplexity int) int
		WaistSize       func(childComplexity int) int
	}

	PerformerAppearance struct {
		As        func(childComplexity int) int
		Performer func(childComplexity int) int
	}

	PerformerDraft struct {
		Aliases         func(childComplexity int) int
		Birthdate       func(childComplexity int) int
		BreastType      func(childComplexity int) int
		CareerEndYear   func(childComplexity int) int
		CareerStartYear func(childComplexity int) int
		Country         func(childComplexity int) int
		Disambiguation  func(childComplexity int) int
		Ethnicity       func(childComplexity int) int
		EyeColor        func(childComplexity int) int
		Gender          func(childComplexity int) int
		HairColor       func(childComplexity int) int
		Height          func(childComplexity int) int
		ID              func(childComplexity int) int
		Image           func(childComplexity int) int
		Measurements    func(childComplexity int) int
		Name            func(childComplexity int) int
		Piercings       func(childComplexity int) int
		Tattoos         func(childComplexity int) int
		Urls            func(childComplexity int) int
	}

	PerformerEdit struct {
		AddedAliases     func(childComplexity int) int
		AddedImages      func(childComplexity int) int
		AddedPiercings   func(childComplexity int) int
		AddedTattoos     func(childComplexity int) int
		AddedUrls        func(childComplexity int) int
		Aliases          func(childComplexity int) int
		BandSize         func(childComplexity int) int
		Birthdate        func(childComplexity int) int
		BreastType       func(childComplexity int) int
		CareerEndYear    func(childComplexity int) int
		CareerStartYear  func(childComplexity int) int
		Country          func(childComplexity int) int
		CupSize          func(childComplexity int) int
		Disambiguation   func(childComplexity int) int
		DraftID          func(childComplexity int) int
		Ethnicity        func(childComplexity int) int
		EyeColor         func(childComplexity int) int
		Gender           func(childComplexity int) int
		HairColor        func(childComplexity int) int
		Height           func(childComplexity int) int
		HipSize          func(childComplexity int) int
		Images           func(childComplexity int) int
		Name             func(childComplexity int) int
		Piercings        func(childComplexity int) int
		RemovedAliases   func(childComplexity int) int
		RemovedImages    func(childComplexity int) int
		RemovedPiercings func(childComplexity int) int
		RemovedTattoos   func(childComplexity int) int
		RemovedUrls      func(childComplexity int) int
		Tattoos          func(childComplexity int) int
		Urls             func(childComplexity int) int
		WaistSize        func(childComplexity int) int
	}

	PerformerEditOptions struct {
		SetMergeAliases  func(childComplexity int) int
		SetModifyAliases func(childComplexity int) int
	}

	PerformerStudio struct {
		SceneCount func(childComplexity int) int
		Studio     func(childComplexity int) int
	}

	Query struct {
		FindDraft                     func(childComplexity int, id uuid.UUID) int
		FindDrafts                    func(childComplexity int) int
		FindEdit                      func(childComplexity int, id uuid.UUID) int
		FindPerformer                 func(childComplexity int, id uuid.UUID) int
		FindScene                     func(childComplexity int, id uuid.UUID) int
		FindSceneByFingerprint        func(childComplexity int, fingerprint FingerprintQueryInput) int
		FindScenesByFingerprints      func(childComplexity int, fingerprints []string) int
		FindScenesByFullFingerprints  func(childComplexity int, fingerprints []*FingerprintQueryInput) int
		FindScenesBySceneFingerprints func(childComplexity int, fingerprints [][]*FingerprintQueryInput) int
		FindSite                      func(childComplexity int, id uuid.UUID) int
		FindStudio                    func(childComplexity int, id *uuid.UUID, name *string) int
		FindTag                       func(childComplexity int, id *uuid.UUID, name *string) int
		FindTagCategory               func(childComplexity int, id uuid.UUID) int
		FindUser                      func(childComplexity int, id *uuid.UUID, username *string) int
		GetConfig                     func(childComplexity int) int
		Me                            func(childComplexity int) int
		QueryEdits                    func(childComplexity int, input EditQueryInput) int
		QueryExistingScene            func(childComplexity int, input QueryExistingSceneInput) int
		QueryPerformers               func(childComplexity int, input PerformerQueryInput) int
		QueryScenes                   func(childComplexity int, input SceneQueryInput) int
		QuerySites                    func(childComplexity int) int
		QueryStudios                  func(childComplexity int, input StudioQueryInput) int
		QueryTagCategories            func(childComplexity int) int
		QueryTags                     func(childComplexity int, input TagQueryInput) int
		QueryUsers                    func(childComplexity int, input UserQueryInput) int
		SearchPerformer               func(childComplexity int, term string, limit *int) int
		SearchScene                   func(childComplexity int, term string, limit *int) int
		SearchTag                     func(childComplexity int, term string, limit *int) int
		Version                       func(childComplexity int) int
	}

	QueryEditsResultType struct {
		Count func(childComplexity int) int
		Edits func(childComplexity int) int
	}

	QueryExistingSceneResult struct {
		Edits  func(childComplexity int) int
		Scenes func(childComplexity int) int
	}

	QueryPerformersResultType struct {
		Count      func(childComplexity int) int
		Performers func(childComplexity int) int
	}

	QueryScenesResultType struct {
		Count  func(childComplexity int) int
		Scenes func(childComplexity int) int
	}

	QuerySitesResultType struct {
		Count func(childComplexity int) int
		Sites func(childComplexity int) int
	}

	QueryStudiosResultType struct {
		Count   func(childComplexity int) int
		Studios func(childComplexity int) int
	}

	QueryTagCategoriesResultType struct {
		Count         func(childComplexity int) int
		TagCategories func(childComplexity int) int
	}

	QueryTagsResultType struct {
		Count func(childComplexity int) int
		Tags  func(childComplexity int) int
	}

	QueryUsersResultType struct {
		Count func(childComplexity int) int
		Users func(childComplexity int) int
	}

	Scene struct {
		Code         func(childComplexity int) int
		Created      func(childComplexity int) int
		Date         func(childComplexity int) int
		Deleted      func(childComplexity int) int
		Details      func(childComplexity int) int
		Director     func(childComplexity int) int
		Duration     func(childComplexity int) int
		Edits        func(childComplexity int) int
		Fingerprints func(childComplexity int, isSubmitted *bool) int
		ID           func(childComplexity int) int
		Images       func(childComplexity int) int
		Performers   func(childComplexity int) int
		ReleaseDate  func(childComplexity int) int
		Studio       func(childComplexity int) int
		Tags         func(childComplexity int) int
		Title        func(childComplexity int) int
		Updated      func(childComplexity int) int
		Urls         func(childComplexity int) int
	}

	SceneDraft struct {
		Code         func(childComplexity int) int
		Date         func(childComplexity int) int
		Details      func(childComplexity int) int
		Director     func(childComplexity int) int
		Fingerprints func(childComplexity int) int
		ID           func(childComplexity int) int
		Image        func(childComplexity int) int
		Performers   func(childComplexity int) int
		Studio       func(childComplexity int) int
		Tags         func(childComplexity int) int
		Title        func(childComplexity int) int
		URL          func(childComplexity int) int
	}

	SceneEdit struct {
		AddedFingerprints   func(childComplexity int) int
		AddedImages         func(childComplexity int) int
		AddedPerformers     func(childComplexity int) int
		AddedTags           func(childComplexity int) int
		AddedUrls           func(childComplexity int) int
		Code                func(childComplexity int) int
		Date                func(childComplexity int) int
		Details             func(childComplexity int) int
		Director            func(childComplexity int) int
		DraftID             func(childComplexity int) int
		Duration            func(childComplexity int) int
		Fingerprints        func(childComplexity int) int
		Images              func(childComplexity int) int
		Performers          func(childComplexity int) int
		RemovedFingerprints func(childComplexity int) int
		RemovedImages       func(childComplexity int) int
		RemovedPerformers   func(childComplexity int) int
		RemovedTags         func(childComplexity int) int
		RemovedUrls         func(childComplexity int) int
		Studio              func(childComplexity int) int
		Tags                func(childComplexity int) int
		Title               func(childComplexity int) int
		Urls                func(childComplexity int) int
	}

	Site struct {
		Created     func(childComplexity int) int
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Icon        func(childComplexity int) int
		Name        func(childComplexity int) int
		Regex       func(childComplexity int) int
		URL         func(childComplexity int) int
		Updated     func(childComplexity int) int
		ValidTypes  func(childComplexity int) int
	}

	StashBoxConfig struct {
		GuidelinesURL              func(childComplexity int) int
		HostURL                    func(childComplexity int) int
		MinDestructiveVotingPeriod func(childComplexity int) int
		RequireActivation          func(childComplexity int) int
		RequireInvite              func(childComplexity int) int
		VoteApplicationThreshold   func(childComplexity int) int
		VoteCronInterval           func(childComplexity int) int
		VotePromotionThreshold     func(childComplexity int) int
		VotingPeriod               func(childComplexity int) int
	}

	Studio struct {
		ChildStudios func(childComplexity int) int
		Created      func(childComplexity int) int
		Deleted      func(childComplexity int) int
		ID           func(childComplexity int) int
		Images       func(childComplexity int) int
		IsFavorite   func(childComplexity int) int
		Name         func(childComplexity int) int
		Parent       func(childComplexity int) int
		Performers   func(childComplexity int, input PerformerQueryInput) int
		Updated      func(childComplexity int) int
		Urls         func(childComplexity int) int
	}

	StudioEdit struct {
		AddedImages   func(childComplexity int) int
		AddedUrls     func(childComplexity int) int
		Images        func(childComplexity int) int
		Name          func(childComplexity int) int
		Parent        func(childComplexity int) int
		RemovedImages func(childComplexity int) int
		RemovedUrls   func(childComplexity int) int
		Urls          func(childComplexity int) int
	}

	Tag struct {
		Aliases     func(childComplexity int) int
		Category    func(childComplexity int) int
		Created     func(childComplexity int) int
		Deleted     func(childComplexity int) int
		Description func(childComplexity int) int
		Edits       func(childComplexity int) int
		ID          func(childComplexity int) int
		Name        func(childComplexity int) int
		Updated     func(childComplexity int) int
	}

	TagCategory struct {
		Description func(childComplexity int) int
		Group       func(childComplexity int) int
		ID          func(childComplexity int) int
		Name        func(childComplexity int) int
	}

	TagEdit struct {
		AddedAliases   func(childComplexity int) int
		Aliases        func(childComplexity int) int
		Category       func(childComplexity int) int
		Description    func(childComplexity int) int
		Name           func(childComplexity int) int
		RemovedAliases func(childComplexity int) int
	}

	URL struct {
		Site func(childComplexity int) int
		Type func(childComplexity int) int
		URL  func(childComplexity int) int
	}

	User struct {
		APICalls          func(childComplexity int) int
		APIKey            func(childComplexity int) int
		ActiveInviteCodes func(childComplexity int) int
		EditCount         func(childComplexity int) int
		Email             func(childComplexity int) int
		ID                func(childComplexity int) int
		InviteCodes       func(childComplexity int) int
		InviteTokens      func(childComplexity int) int
		InvitedBy         func(childComplexity int) int
		Name              func(childComplexity int) int
		Roles             func(childComplexity int) int
		VoteCount         func(childComplexity int) int
	}

	UserEditCount struct {
		Accepted          func(childComplexity int) int
		Canceled          func(childComplexity int) int
		Failed            func(childComplexity int) int
		ImmediateAccepted func(childComplexity int) int
		ImmediateRejected func(childComplexity int) int
		Pending           func(childComplexity int) int
		Rejected          func(childComplexity int) int
	}

	UserVoteCount struct {
		Abstain         func(childComplexity int) int
		Accept          func(childComplexity int) int
		ImmediateAccept func(childComplexity int) int
		ImmediateReject func(childComplexity int) int
		Reject          func(childComplexity int) int
	}

	Version struct {
		BuildTime func(childComplexity int) int
		BuildType func(childComplexity int) int
		Hash      func(childComplexity int) int
		Version   func(childComplexity int) int
	}
}

type Config added in v0.1.0

type Config struct {
	Schema     *ast.Schema
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type CriterionModifier added in v0.1.0

type CriterionModifier string
const (
	// =
	CriterionModifierEquals CriterionModifier = "EQUALS"
	// !=
	CriterionModifierNotEquals CriterionModifier = "NOT_EQUALS"
	// >
	CriterionModifierGreaterThan CriterionModifier = "GREATER_THAN"
	// <
	CriterionModifierLessThan CriterionModifier = "LESS_THAN"
	// IS NULL
	CriterionModifierIsNull CriterionModifier = "IS_NULL"
	// IS NOT NULL
	CriterionModifierNotNull CriterionModifier = "NOT_NULL"
	// INCLUDES ALL
	CriterionModifierIncludesAll CriterionModifier = "INCLUDES_ALL"
	CriterionModifierIncludes    CriterionModifier = "INCLUDES"
	CriterionModifierExcludes    CriterionModifier = "EXCLUDES"
)

func (CriterionModifier) IsValid added in v0.1.0

func (e CriterionModifier) IsValid() bool

func (CriterionModifier) MarshalGQL added in v0.1.0

func (e CriterionModifier) MarshalGQL(w io.Writer)

func (CriterionModifier) String added in v0.1.0

func (e CriterionModifier) String() string

func (*CriterionModifier) UnmarshalGQL added in v0.1.0

func (e *CriterionModifier) UnmarshalGQL(v interface{}) error

type DBSceneFingerprint added in v0.5.1

type DBSceneFingerprint struct {
	SceneID       uuid.UUID `db:"scene_id" json:"scene_id"`
	UserID        uuid.UUID `db:"user_id" json:"user_id"`
	FingerprintID int       `db:"fingerprint_id" json:"fingerprint_id"`
	Duration      int       `db:"duration" json:"duration"`
	CreatedAt     time.Time `db:"created_at" json:"created_at"`
}

type DBSceneFingerprints added in v0.5.1

type DBSceneFingerprints []*DBSceneFingerprint

func (*DBSceneFingerprints) Add added in v0.5.1

func (f *DBSceneFingerprints) Add(o interface{})

func (DBSceneFingerprints) Each added in v0.5.1

func (f DBSceneFingerprints) Each(fn func(interface{}))

func (DBSceneFingerprints) EachPtr added in v0.5.1

func (f DBSceneFingerprints) EachPtr(fn func(interface{}))

type DateAccuracyEnum added in v0.1.0

type DateAccuracyEnum string
const (
	DateAccuracyEnumYear  DateAccuracyEnum = "YEAR"
	DateAccuracyEnumMonth DateAccuracyEnum = "MONTH"
	DateAccuracyEnumDay   DateAccuracyEnum = "DAY"
)

func (DateAccuracyEnum) IsValid added in v0.1.0

func (e DateAccuracyEnum) IsValid() bool

func (DateAccuracyEnum) MarshalGQL added in v0.1.0

func (e DateAccuracyEnum) MarshalGQL(w io.Writer)

func (DateAccuracyEnum) String added in v0.1.0

func (e DateAccuracyEnum) String() string

func (*DateAccuracyEnum) UnmarshalGQL added in v0.1.0

func (e *DateAccuracyEnum) UnmarshalGQL(v interface{}) error

type DateCriterionInput added in v0.1.0

type DateCriterionInput struct {
	Value    string            `json:"value"`
	Modifier CriterionModifier `json:"modifier"`
}

type DirectiveRoot added in v0.1.0

type DirectiveRoot struct {
	HasRole     func(ctx context.Context, obj interface{}, next graphql.Resolver, role RoleEnum) (res interface{}, err error)
	IsUserOwner func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
}

type Draft added in v0.1.0

type Draft struct {
	ID        uuid.UUID      `db:"id" json:"id"`
	UserID    uuid.UUID      `db:"user_id" json:"user_id"`
	Type      string         `db:"type" json:"type"`
	Data      types.JSONText `db:"data" json:"data"`
	CreatedAt time.Time      `db:"created_at" json:"created_at"`
}

func NewDraft added in v0.1.0

func NewDraft(id uuid.UUID, user *User, targetType TargetTypeEnum) *Draft

func (Draft) GetID added in v0.1.0

func (e Draft) GetID() uuid.UUID

func (*Draft) GetPerformerData added in v0.1.0

func (e *Draft) GetPerformerData() (*PerformerDraft, error)

func (*Draft) GetSceneData added in v0.1.0

func (e *Draft) GetSceneData() (*SceneDraft, error)

func (*Draft) SetData added in v0.1.0

func (e *Draft) SetData(data interface{}) error

type DraftData added in v0.1.0

type DraftData interface {
	IsDraftData()
}

type DraftEntity added in v0.1.0

type DraftEntity struct {
	Name string     `json:"name"`
	ID   *uuid.UUID `json:"id,omitempty"`
}

func (DraftEntity) IsSceneDraftPerformer added in v0.1.0

func (DraftEntity) IsSceneDraftPerformer()

func (DraftEntity) IsSceneDraftStudio added in v0.1.0

func (DraftEntity) IsSceneDraftStudio()

func (DraftEntity) IsSceneDraftTag added in v0.1.0

func (DraftEntity) IsSceneDraftTag()

type DraftEntityInput added in v0.1.0

type DraftEntityInput struct {
	Name string     `json:"name"`
	ID   *uuid.UUID `json:"id,omitempty"`
}

type DraftFingerprint added in v0.1.0

type DraftFingerprint struct {
	Hash      string               `json:"hash"`
	Algorithm FingerprintAlgorithm `json:"algorithm"`
	Duration  int                  `json:"duration"`
}

type DraftRepo added in v0.1.0

type DraftRepo interface {
	Create(newEdit Draft) (*Draft, error)
	Destroy(id uuid.UUID) error
	Find(id uuid.UUID) (*Draft, error)
	FindByUser(userID uuid.UUID) ([]*Draft, error)
	FindExpired(timeLimit int) ([]*Draft, error)
}

type DraftResolver added in v0.1.0

type DraftResolver interface {
	Created(ctx context.Context, obj *Draft) (*time.Time, error)
	Expires(ctx context.Context, obj *Draft) (*time.Time, error)
	Data(ctx context.Context, obj *Draft) (DraftData, error)
}

type DraftSubmissionStatus added in v0.1.0

type DraftSubmissionStatus struct {
	ID *uuid.UUID `json:"id,omitempty"`
}

type Drafts added in v0.1.0

type Drafts []*Draft

func (*Drafts) Add added in v0.1.0

func (p *Drafts) Add(o interface{})

func (Drafts) Each added in v0.1.0

func (p Drafts) Each(fn func(interface{}))

type Edit

type Edit struct {
	ID         uuid.UUID      `db:"id" json:"id"`
	UserID     uuid.NullUUID  `db:"user_id" json:"user_id"`
	TargetType string         `db:"target_type" json:"target_type"`
	Operation  string         `db:"operation" json:"operation"`
	VoteCount  int            `db:"votes" json:"votes"`
	Status     string         `db:"status" json:"status"`
	Applied    bool           `db:"applied" json:"applied"`
	Data       types.JSONText `db:"data" json:"data"`
	Bot        bool           `db:"bot" json:"bot"`
	CreatedAt  time.Time      `db:"created_at" json:"created_at"`
	UpdatedAt  sql.NullTime   `db:"updated_at" json:"updated_at"`
	ClosedAt   sql.NullTime   `db:"closed_at" json:"closed_at"`
}

func NewEdit

func NewEdit(id uuid.UUID, user *User, targetType TargetTypeEnum, input *EditInput) *Edit

func (*Edit) Accept added in v0.1.0

func (e *Edit) Accept()

func (*Edit) Cancel added in v0.1.0

func (e *Edit) Cancel()

func (*Edit) Fail added in v0.1.0

func (e *Edit) Fail()

func (*Edit) GetData

func (e *Edit) GetData() *EditData

func (Edit) GetID

func (e Edit) GetID() uuid.UUID

func (*Edit) GetPerformerData

func (e *Edit) GetPerformerData() (*PerformerEditData, error)

func (*Edit) GetSceneData added in v0.1.0

func (e *Edit) GetSceneData() (*SceneEditData, error)

func (*Edit) GetStudioData added in v0.1.0

func (e *Edit) GetStudioData() (*StudioEditData, error)

func (*Edit) GetTagData

func (e *Edit) GetTagData() (*TagEditData, error)

func (*Edit) ImmediateAccept

func (e *Edit) ImmediateAccept()

func (*Edit) ImmediateReject

func (e *Edit) ImmediateReject()

func (*Edit) IsDestructive added in v0.1.0

func (e *Edit) IsDestructive() bool

func (*Edit) Reject added in v0.1.0

func (e *Edit) Reject()

func (*Edit) SetData

func (e *Edit) SetData(data interface{}) error

type EditComment

type EditComment struct {
	ID        uuid.UUID     `db:"id" json:"id"`
	EditID    uuid.UUID     `db:"edit_id" json:"edit_id"`
	UserID    uuid.NullUUID `db:"user_id" json:"user_id"`
	CreatedAt time.Time     `db:"created_at" json:"created_at"`
	Text      string        `db:"text" json:"text"`
}

func NewEditComment

func NewEditComment(id uuid.UUID, user *User, edit *Edit, text string) *EditComment

type EditCommentInput added in v0.1.0

type EditCommentInput struct {
	ID      uuid.UUID `json:"id"`
	Comment string    `json:"comment"`
}

type EditCommentResolver added in v0.1.0

type EditCommentResolver interface {
	User(ctx context.Context, obj *EditComment) (*User, error)
	Date(ctx context.Context, obj *EditComment) (*time.Time, error)
	Comment(ctx context.Context, obj *EditComment) (string, error)
}

type EditComments

type EditComments []*EditComment

func (*EditComments) Add

func (p *EditComments) Add(o interface{})

func (EditComments) Each

func (p EditComments) Each(fn func(interface{}))

type EditData

type EditData struct {
	New          *json.RawMessage `json:"new_data,omitempty"`
	Old          *json.RawMessage `json:"old_data,omitempty"`
	MergeSources []uuid.UUID      `json:"merge_sources,omitempty"`
}

type EditDetails added in v0.1.0

type EditDetails interface {
	IsEditDetails()
}

type EditInput added in v0.1.0

type EditInput struct {
	// Not required for create type
	ID        *uuid.UUID    `json:"id,omitempty"`
	Operation OperationEnum `json:"operation"`
	// Only required for merge type
	MergeSourceIds []uuid.UUID `json:"merge_source_ids,omitempty"`
	Comment        *string     `json:"comment,omitempty"`
	// Edit submitted by an automated script. Requires bot permission
	Bot *bool `json:"bot,omitempty"`
}

type EditPerformer

type EditPerformer struct {
	EditID      uuid.UUID `db:"edit_id" json:"edit_id"`
	PerformerID uuid.UUID `db:"performer_id" json:"performer_id"`
}

type EditPerformers

type EditPerformers []*EditPerformer

func (*EditPerformers) Add

func (p *EditPerformers) Add(o interface{})

func (EditPerformers) Each

func (p EditPerformers) Each(fn func(interface{}))

type EditQuery added in v0.1.0

type EditQuery struct {
	Filter EditQueryInput
}

type EditQueryInput added in v0.1.6

type EditQueryInput struct {
	// Filter by user id
	UserID *uuid.UUID `json:"user_id,omitempty"`
	// Filter by status
	Status *VoteStatusEnum `json:"status,omitempty"`
	// Filter by operation
	Operation *OperationEnum `json:"operation,omitempty"`
	// Filter by vote count
	VoteCount *IntCriterionInput `json:"vote_count,omitempty"`
	// Filter by applied status
	Applied *bool `json:"applied,omitempty"`
	// Filter by target type
	TargetType *TargetTypeEnum `json:"target_type,omitempty"`
	// Filter by target id
	TargetID *uuid.UUID `json:"target_id,omitempty"`
	// Filter by favorite status
	IsFavorite *bool `json:"is_favorite,omitempty"`
	// Filter by user voted status
	Voted *UserVotedFilterEnum `json:"voted,omitempty"`
	// Filter to bot edits only
	IsBot *bool `json:"is_bot,omitempty"`
	// Filter out user's own edits
	IncludeUserSubmitted *bool             `json:"include_user_submitted,omitempty"`
	Page                 int               `json:"page"`
	PerPage              int               `json:"per_page"`
	Direction            SortDirectionEnum `json:"direction"`
	Sort                 EditSortEnum      `json:"sort"`
}

type EditRepo

type EditRepo interface {
	Create(newEdit Edit) (*Edit, error)
	Update(updatedEdit Edit) (*Edit, error)
	Destroy(id uuid.UUID) error
	Find(id uuid.UUID) (*Edit, error)
	CreateEditTag(newJoin EditTag) error
	CreateEditPerformer(newJoin EditPerformer) error
	CreateEditStudio(newJoin EditStudio) error
	CreateEditScene(newJoin EditScene) error
	FindTagID(id uuid.UUID) (*uuid.UUID, error)
	FindPerformerID(id uuid.UUID) (*uuid.UUID, error)
	FindStudioID(id uuid.UUID) (*uuid.UUID, error)
	FindSceneID(id uuid.UUID) (*uuid.UUID, error)
	Count() (int, error)
	QueryEdits(filter EditQueryInput, userID uuid.UUID) ([]*Edit, error)
	QueryCount(filter EditQueryInput, userID uuid.UUID) (int, error)
	CreateComment(newJoin EditComment) error
	CreateVote(newJoin EditVote) error
	GetComments(id uuid.UUID) (EditComments, error)
	GetVotes(id uuid.UUID) (EditVotes, error)
	FindByTagID(id uuid.UUID) ([]*Edit, error)
	FindByPerformerID(id uuid.UUID) ([]*Edit, error)
	FindByStudioID(id uuid.UUID) ([]*Edit, error)
	FindBySceneID(id uuid.UUID) ([]*Edit, error)
	FindCompletedEdits(int, int, int) ([]*Edit, error)
	FindPendingSceneCreation(input QueryExistingSceneInput) ([]*Edit, error)
	CancelUserEdits(userID uuid.UUID) error
}

type EditResolver added in v0.1.0

type EditResolver interface {
	User(ctx context.Context, obj *Edit) (*User, error)
	Target(ctx context.Context, obj *Edit) (EditTarget, error)
	TargetType(ctx context.Context, obj *Edit) (TargetTypeEnum, error)
	MergeSources(ctx context.Context, obj *Edit) ([]EditTarget, error)
	Operation(ctx context.Context, obj *Edit) (OperationEnum, error)

	Details(ctx context.Context, obj *Edit) (EditDetails, error)
	OldDetails(ctx context.Context, obj *Edit) (EditDetails, error)
	Options(ctx context.Context, obj *Edit) (*PerformerEditOptions, error)
	Comments(ctx context.Context, obj *Edit) ([]*EditComment, error)
	Votes(ctx context.Context, obj *Edit) ([]*EditVote, error)

	Destructive(ctx context.Context, obj *Edit) (bool, error)
	Status(ctx context.Context, obj *Edit) (VoteStatusEnum, error)

	Created(ctx context.Context, obj *Edit) (*time.Time, error)
	Updated(ctx context.Context, obj *Edit) (*time.Time, error)
	Closed(ctx context.Context, obj *Edit) (*time.Time, error)
	Expires(ctx context.Context, obj *Edit) (*time.Time, error)
}

type EditScene added in v0.1.0

type EditScene struct {
	EditID  uuid.UUID `db:"edit_id" json:"edit_id"`
	SceneID uuid.UUID `db:"scene_id" json:"scene_id"`
}

type EditScenes added in v0.1.0

type EditScenes []*EditScene

func (*EditScenes) Add added in v0.1.0

func (p *EditScenes) Add(o interface{})

func (EditScenes) Each added in v0.1.0

func (p EditScenes) Each(fn func(interface{}))

type EditSortEnum added in v0.1.6

type EditSortEnum string
const (
	EditSortEnumCreatedAt EditSortEnum = "CREATED_AT"
	EditSortEnumUpdatedAt EditSortEnum = "UPDATED_AT"
	EditSortEnumClosedAt  EditSortEnum = "CLOSED_AT"
)

func (EditSortEnum) IsValid added in v0.1.6

func (e EditSortEnum) IsValid() bool

func (EditSortEnum) MarshalGQL added in v0.1.6

func (e EditSortEnum) MarshalGQL(w io.Writer)

func (EditSortEnum) String added in v0.1.6

func (e EditSortEnum) String() string

func (*EditSortEnum) UnmarshalGQL added in v0.1.6

func (e *EditSortEnum) UnmarshalGQL(v interface{}) error

type EditStudio added in v0.1.0

type EditStudio struct {
	EditID   uuid.UUID `db:"edit_id" json:"edit_id"`
	StudioID uuid.UUID `db:"studio_id" json:"studio_id"`
}

type EditStudios added in v0.1.0

type EditStudios []*EditStudio

func (*EditStudios) Add added in v0.1.0

func (p *EditStudios) Add(o interface{})

func (EditStudios) Each added in v0.1.0

func (p EditStudios) Each(fn func(interface{}))

type EditTag

type EditTag struct {
	EditID uuid.UUID `db:"edit_id" json:"edit_id"`
	TagID  uuid.UUID `db:"tag_id" json:"tag_id"`
}

type EditTags

type EditTags []*EditTag

func (*EditTags) Add

func (p *EditTags) Add(o interface{})

func (EditTags) Each

func (p EditTags) Each(fn func(interface{}))

type EditTarget added in v0.1.0

type EditTarget interface {
	IsEditTarget()
}

type EditVote added in v0.1.0

type EditVote struct {
	EditID    uuid.UUID     `db:"edit_id" json:"edit_id"`
	UserID    uuid.NullUUID `db:"user_id" json:"user_id"`
	CreatedAt time.Time     `db:"created_at" json:"created_at"`
	Vote      string        `db:"vote" json:"vote"`
}

func NewEditVote added in v0.1.0

func NewEditVote(user *User, edit *Edit, vote VoteTypeEnum) *EditVote

type EditVoteInput added in v0.1.0

type EditVoteInput struct {
	ID   uuid.UUID    `json:"id"`
	Vote VoteTypeEnum `json:"vote"`
}

type EditVoteResolver added in v0.1.0

type EditVoteResolver interface {
	User(ctx context.Context, obj *EditVote) (*User, error)
	Date(ctx context.Context, obj *EditVote) (*time.Time, error)
	Vote(ctx context.Context, obj *EditVote) (VoteTypeEnum, error)
}

type EditVotes added in v0.1.0

type EditVotes []*EditVote

func (*EditVotes) Add added in v0.1.0

func (p *EditVotes) Add(o interface{})

func (EditVotes) Each added in v0.1.0

func (p EditVotes) Each(fn func(interface{}))

type Edits

type Edits []*Edit

func (*Edits) Add

func (p *Edits) Add(o interface{})

func (Edits) Each

func (p Edits) Each(fn func(interface{}))

type ErrEditPrerequisiteFailed added in v0.1.0

type ErrEditPrerequisiteFailed struct {
	// contains filtered or unexported fields
}

func (*ErrEditPrerequisiteFailed) Error added in v0.1.0

func (e *ErrEditPrerequisiteFailed) Error() string

type EthnicityEnum added in v0.1.0

type EthnicityEnum string
const (
	EthnicityEnumCaucasian     EthnicityEnum = "CAUCASIAN"
	EthnicityEnumBlack         EthnicityEnum = "BLACK"
	EthnicityEnumAsian         EthnicityEnum = "ASIAN"
	EthnicityEnumIndian        EthnicityEnum = "INDIAN"
	EthnicityEnumLatin         EthnicityEnum = "LATIN"
	EthnicityEnumMiddleEastern EthnicityEnum = "MIDDLE_EASTERN"
	EthnicityEnumMixed         EthnicityEnum = "MIXED"
	EthnicityEnumOther         EthnicityEnum = "OTHER"
)

func (EthnicityEnum) IsValid added in v0.1.0

func (e EthnicityEnum) IsValid() bool

func (EthnicityEnum) MarshalGQL added in v0.1.0

func (e EthnicityEnum) MarshalGQL(w io.Writer)

func (EthnicityEnum) String added in v0.1.0

func (e EthnicityEnum) String() string

func (*EthnicityEnum) UnmarshalGQL added in v0.1.0

func (e *EthnicityEnum) UnmarshalGQL(v interface{}) error

type EthnicityFilterEnum added in v0.1.0

type EthnicityFilterEnum string
const (
	EthnicityFilterEnumUnknown       EthnicityFilterEnum = "UNKNOWN"
	EthnicityFilterEnumCaucasian     EthnicityFilterEnum = "CAUCASIAN"
	EthnicityFilterEnumBlack         EthnicityFilterEnum = "BLACK"
	EthnicityFilterEnumAsian         EthnicityFilterEnum = "ASIAN"
	EthnicityFilterEnumIndian        EthnicityFilterEnum = "INDIAN"
	EthnicityFilterEnumLatin         EthnicityFilterEnum = "LATIN"
	EthnicityFilterEnumMiddleEastern EthnicityFilterEnum = "MIDDLE_EASTERN"
	EthnicityFilterEnumMixed         EthnicityFilterEnum = "MIXED"
	EthnicityFilterEnumOther         EthnicityFilterEnum = "OTHER"
)

func (EthnicityFilterEnum) IsValid added in v0.1.0

func (e EthnicityFilterEnum) IsValid() bool

func (EthnicityFilterEnum) MarshalGQL added in v0.1.0

func (e EthnicityFilterEnum) MarshalGQL(w io.Writer)

func (EthnicityFilterEnum) String added in v0.1.0

func (e EthnicityFilterEnum) String() string

func (*EthnicityFilterEnum) UnmarshalGQL added in v0.1.0

func (e *EthnicityFilterEnum) UnmarshalGQL(v interface{}) error

type EyeColorCriterionInput added in v0.1.0

type EyeColorCriterionInput struct {
	Value    *EyeColorEnum     `json:"value,omitempty"`
	Modifier CriterionModifier `json:"modifier"`
}

type EyeColorEnum added in v0.1.0

type EyeColorEnum string
const (
	EyeColorEnumBlue  EyeColorEnum = "BLUE"
	EyeColorEnumBrown EyeColorEnum = "BROWN"
	EyeColorEnumGrey  EyeColorEnum = "GREY"
	EyeColorEnumGreen EyeColorEnum = "GREEN"
	EyeColorEnumHazel EyeColorEnum = "HAZEL"
	EyeColorEnumRed   EyeColorEnum = "RED"
)

func (EyeColorEnum) IsValid added in v0.1.0

func (e EyeColorEnum) IsValid() bool

func (EyeColorEnum) MarshalGQL added in v0.1.0

func (e EyeColorEnum) MarshalGQL(w io.Writer)

func (EyeColorEnum) String added in v0.1.0

func (e EyeColorEnum) String() string

func (*EyeColorEnum) UnmarshalGQL added in v0.1.0

func (e *EyeColorEnum) UnmarshalGQL(v interface{}) error

type FavoriteFilter added in v0.2.7

type FavoriteFilter string
const (
	FavoriteFilterPerformer FavoriteFilter = "PERFORMER"
	FavoriteFilterStudio    FavoriteFilter = "STUDIO"
	FavoriteFilterAll       FavoriteFilter = "ALL"
)

func (FavoriteFilter) IsValid added in v0.2.7

func (e FavoriteFilter) IsValid() bool

func (FavoriteFilter) MarshalGQL added in v0.2.7

func (e FavoriteFilter) MarshalGQL(w io.Writer)

func (FavoriteFilter) String added in v0.2.7

func (e FavoriteFilter) String() string

func (*FavoriteFilter) UnmarshalGQL added in v0.2.7

func (e *FavoriteFilter) UnmarshalGQL(v interface{}) error

type Fingerprint added in v0.1.0

type Fingerprint struct {
	Hash          string               `json:"hash"`
	Algorithm     FingerprintAlgorithm `json:"algorithm"`
	Duration      int                  `json:"duration"`
	Submissions   int                  `json:"submissions"`
	Created       time.Time            `json:"created"`
	Updated       time.Time            `json:"updated"`
	UserSubmitted bool                 `json:"user_submitted"`
}

type FingerprintAlgorithm added in v0.1.0

type FingerprintAlgorithm string
const (
	FingerprintAlgorithmMd5    FingerprintAlgorithm = "MD5"
	FingerprintAlgorithmOshash FingerprintAlgorithm = "OSHASH"
	FingerprintAlgorithmPhash  FingerprintAlgorithm = "PHASH"
)

func (FingerprintAlgorithm) IsValid added in v0.1.0

func (e FingerprintAlgorithm) IsValid() bool

func (FingerprintAlgorithm) MarshalGQL added in v0.1.0

func (e FingerprintAlgorithm) MarshalGQL(w io.Writer)

func (FingerprintAlgorithm) String added in v0.1.0

func (e FingerprintAlgorithm) String() string

func (*FingerprintAlgorithm) UnmarshalGQL added in v0.1.0

func (e *FingerprintAlgorithm) UnmarshalGQL(v interface{}) error

type FingerprintEditInput added in v0.1.0

type FingerprintEditInput struct {
	UserIds     []uuid.UUID          `json:"user_ids,omitempty"`
	Hash        string               `json:"hash"`
	Algorithm   FingerprintAlgorithm `json:"algorithm"`
	Duration    int                  `json:"duration"`
	Created     time.Time            `json:"created"`
	Submissions *int                 `json:"submissions,omitempty"`
	Updated     *time.Time           `json:"updated,omitempty"`
}

type FingerprintInput added in v0.1.0

type FingerprintInput struct {
	// assumes current user if omitted. Ignored for non-modify Users
	UserIds   []uuid.UUID          `json:"user_ids,omitempty"`
	Hash      string               `json:"hash"`
	Algorithm FingerprintAlgorithm `json:"algorithm"`
	Duration  int                  `json:"duration"`
}

type FingerprintQueryInput added in v0.1.0

type FingerprintQueryInput struct {
	Hash      string               `json:"hash"`
	Algorithm FingerprintAlgorithm `json:"algorithm"`
}

type FingerprintSubmission added in v0.1.0

type FingerprintSubmission struct {
	SceneID     uuid.UUID         `json:"scene_id"`
	Fingerprint *FingerprintInput `json:"fingerprint"`
	Unmatch     *bool             `json:"unmatch,omitempty"`
}

type FuzzyDate added in v0.1.0

type FuzzyDate struct {
	Date     string           `json:"date"`
	Accuracy DateAccuracyEnum `json:"accuracy"`
}

type GenderEnum added in v0.1.0

type GenderEnum string
const (
	GenderEnumMale              GenderEnum = "MALE"
	GenderEnumFemale            GenderEnum = "FEMALE"
	GenderEnumTransgenderMale   GenderEnum = "TRANSGENDER_MALE"
	GenderEnumTransgenderFemale GenderEnum = "TRANSGENDER_FEMALE"
	GenderEnumIntersex          GenderEnum = "INTERSEX"
	GenderEnumNonBinary         GenderEnum = "NON_BINARY"
)

func (GenderEnum) IsValid added in v0.1.0

func (e GenderEnum) IsValid() bool

func (GenderEnum) MarshalGQL added in v0.1.0

func (e GenderEnum) MarshalGQL(w io.Writer)

func (GenderEnum) String added in v0.1.0

func (e GenderEnum) String() string

func (*GenderEnum) UnmarshalGQL added in v0.1.0

func (e *GenderEnum) UnmarshalGQL(v interface{}) error

type GenderFilterEnum added in v0.1.0

type GenderFilterEnum string
const (
	GenderFilterEnumUnknown           GenderFilterEnum = "UNKNOWN"
	GenderFilterEnumMale              GenderFilterEnum = "MALE"
	GenderFilterEnumFemale            GenderFilterEnum = "FEMALE"
	GenderFilterEnumTransgenderMale   GenderFilterEnum = "TRANSGENDER_MALE"
	GenderFilterEnumTransgenderFemale GenderFilterEnum = "TRANSGENDER_FEMALE"
	GenderFilterEnumIntersex          GenderFilterEnum = "INTERSEX"
	GenderFilterEnumNonBinary         GenderFilterEnum = "NON_BINARY"
)

func (GenderFilterEnum) IsValid added in v0.1.0

func (e GenderFilterEnum) IsValid() bool

func (GenderFilterEnum) MarshalGQL added in v0.1.0

func (e GenderFilterEnum) MarshalGQL(w io.Writer)

func (GenderFilterEnum) String added in v0.1.0

func (e GenderFilterEnum) String() string

func (*GenderFilterEnum) UnmarshalGQL added in v0.1.0

func (e *GenderFilterEnum) UnmarshalGQL(v interface{}) error

type GenerateInviteCodeInput added in v0.5.1

type GenerateInviteCodeInput struct {
	Keys *int `json:"keys,omitempty"`
	Uses *int `json:"uses,omitempty"`
	TTL  *int `json:"ttl,omitempty"`
}

type GrantInviteInput added in v0.1.0

type GrantInviteInput struct {
	UserID uuid.UUID `json:"user_id"`
	Amount int       `json:"amount"`
}

type HairColorCriterionInput added in v0.1.0

type HairColorCriterionInput struct {
	Value    *HairColorEnum    `json:"value,omitempty"`
	Modifier CriterionModifier `json:"modifier"`
}

type HairColorEnum added in v0.1.0

type HairColorEnum string
const (
	HairColorEnumBlonde   HairColorEnum = "BLONDE"
	HairColorEnumBrunette HairColorEnum = "BRUNETTE"
	HairColorEnumBlack    HairColorEnum = "BLACK"
	HairColorEnumRed      HairColorEnum = "RED"
	HairColorEnumAuburn   HairColorEnum = "AUBURN"
	HairColorEnumGrey     HairColorEnum = "GREY"
	HairColorEnumBald     HairColorEnum = "BALD"
	HairColorEnumVarious  HairColorEnum = "VARIOUS"
	HairColorEnumOther    HairColorEnum = "OTHER"
)

func (HairColorEnum) IsValid added in v0.1.0

func (e HairColorEnum) IsValid() bool

func (HairColorEnum) MarshalGQL added in v0.1.0

func (e HairColorEnum) MarshalGQL(w io.Writer)

func (HairColorEnum) String added in v0.1.0

func (e HairColorEnum) String() string

func (*HairColorEnum) UnmarshalGQL added in v0.1.0

func (e *HairColorEnum) UnmarshalGQL(v interface{}) error

type ID added in v0.1.0

type ID uuid.UUID

type IDCriterionInput added in v0.1.0

type IDCriterionInput struct {
	Value    []uuid.UUID       `json:"value"`
	Modifier CriterionModifier `json:"modifier"`
}

type Image

type Image struct {
	ID        uuid.UUID      `db:"id" json:"id"`
	RemoteURL sql.NullString `db:"url" json:"url"`
	Checksum  string         `db:"checksum" json:"checksum"`
	Width     int64          `db:"width" json:"width"`
	Height    int64          `db:"height" json:"height"`
}

func (*Image) CopyFromCreateInput

func (p *Image) CopyFromCreateInput(input ImageCreateInput)

func (*Image) CopyFromUpdateInput

func (p *Image) CopyFromUpdateInput(input ImageUpdateInput)

func (Image) GetID

func (p Image) GetID() uuid.UUID

func (*Image) IsEditTarget

func (p *Image) IsEditTarget()

type ImageCreateInput added in v0.1.0

type ImageCreateInput struct {
	URL  *string         `json:"url,omitempty"`
	File *graphql.Upload `json:"file,omitempty"`
}

type ImageCreator

type ImageCreator interface {
	Create(newImage Image) (*Image, error)
}

type ImageDestroyInput added in v0.1.0

type ImageDestroyInput struct {
	ID uuid.UUID `json:"id"`
}

type ImageDestroyer

type ImageDestroyer interface {
	Destroy(id uuid.UUID) error
}

type ImageFinder

type ImageFinder interface {
	Find(id uuid.UUID) (*Image, error)
	FindByChecksum(checksum string) (*Image, error)
	FindByPerformerID(performerID uuid.UUID) (Images, error)
	FindUnused() ([]*Image, error)
	IsUnused(imageID uuid.UUID) (bool, error)
}

type ImageRepo

type ImageRepo interface {
	ImageCreator
	ImageDestroyer
	ImageFinder

	FindByIds(ids []uuid.UUID) ([]*Image, []error)
	FindIdsBySceneIds(ids []uuid.UUID) ([][]uuid.UUID, []error)
	FindIdsByPerformerIds(ids []uuid.UUID) ([][]uuid.UUID, []error)
	FindBySceneID(sceneID uuid.UUID) ([]*Image, error)
	FindByPerformerID(performerID uuid.UUID) (Images, error)
	FindByStudioID(studioID uuid.UUID) ([]*Image, error)
	FindIdsByStudioIds(ids []uuid.UUID) ([][]uuid.UUID, []error)
}

type ImageResolver added in v0.1.0

type ImageResolver interface {
	URL(ctx context.Context, obj *Image) (string, error)
}

type ImageUpdateInput added in v0.1.0

type ImageUpdateInput struct {
	ID  uuid.UUID `json:"id"`
	URL *string   `json:"url,omitempty"`
}

type Images

type Images []*Image

func (*Images) Add

func (p *Images) Add(o interface{})

func (Images) Each

func (p Images) Each(fn func(interface{}))

func (Images) OrderLandscape

func (p Images) OrderLandscape()

func (Images) OrderPortrait

func (p Images) OrderPortrait()

func (Images) ToURLSlice

func (p Images) ToURLSlice() []string

type IntCriterionInput added in v0.1.0

type IntCriterionInput struct {
	Value    int               `json:"value"`
	Modifier CriterionModifier `json:"modifier"`
}

type InviteKey

type InviteKey struct {
	ID          uuid.UUID  `json:"id"`
	Uses        *int       `json:"uses"`
	GeneratedBy uuid.UUID  `json:"generated_by"`
	GeneratedAt time.Time  `json:"generated_at"`
	Expires     *time.Time `json:"expires"`
}

func (InviteKey) GetID

func (p InviteKey) GetID() uuid.UUID

func (InviteKey) String added in v0.5.1

func (p InviteKey) String() string

type InviteKeyCreator

type InviteKeyCreator interface {
	Create(newKey InviteKey) (*InviteKey, error)
}

type InviteKeyDestroyer

type InviteKeyDestroyer interface {
	InviteKeyFinder
	Destroy(id uuid.UUID) error
	DestroyExpired() error
}

type InviteKeyFinder

type InviteKeyFinder interface {
	Find(id uuid.UUID) (*InviteKey, error)
	FindActiveKeysForUser(userID uuid.UUID, expireTime time.Time) (InviteKeys, error)
}

type InviteKeyUser added in v0.5.1

type InviteKeyUser interface {
	KeyUsed(id uuid.UUID) (*int, error)
}

type InviteKeys

type InviteKeys []*InviteKey

func (*InviteKeys) Add

func (p *InviteKeys) Add(o interface{})

func (InviteKeys) Each

func (p InviteKeys) Each(fn func(interface{}))

type JSONTime

type JSONTime struct {
	time.Time
}

func (*JSONTime) MarshalJSON

func (jt *JSONTime) MarshalJSON() ([]byte, error)

func (*JSONTime) UnmarshalJSON

func (jt *JSONTime) UnmarshalJSON(b []byte) (err error)

type JoinsRepo

type JoinsRepo interface {
	CreatePerformersScenes(newJoins PerformersScenes) error
	UpdatePerformersScenes(sceneID uuid.UUID, updatedJoins PerformersScenes) error
	DestroyPerformersScenes(sceneID uuid.UUID) error
	CreateScenesTags(newJoins ScenesTags) error
	UpdateScenesTags(sceneID uuid.UUID, updatedJoins ScenesTags) error
	DestroyScenesTags(sceneID uuid.UUID) error
	CreateScenesImages(newJoins ScenesImages) error
	UpdateScenesImages(sceneID uuid.UUID, updatedJoins ScenesImages) error
	DestroyScenesImages(sceneID uuid.UUID) error
	CreatePerformersImages(newJoins PerformersImages) error
	UpdatePerformersImages(performerID uuid.UUID, updatedJoins PerformersImages) error
	DestroyPerformersImages(performerID uuid.UUID) error
	CreateStudiosImages(newJoins StudiosImages) error
	UpdateStudiosImages(studioID uuid.UUID, updatedJoins StudiosImages) error
	DestroyStudiosImages(studioID uuid.UUID) error
	AddStudioFavorite(join StudioFavorite) error
	AddPerformerFavorite(join PerformerFavorite) error
	DestroyStudioFavorite(join StudioFavorite) error
	DestroyPerformerFavorite(join PerformerFavorite) error
	IsPerformerFavorite(favorite PerformerFavorite) (bool, error)
	IsStudioFavorite(favorite StudioFavorite) (bool, error)
}

type Measurements added in v0.1.0

type Measurements struct {
	CupSize  *string `json:"cup_size,omitempty"`
	BandSize *int    `json:"band_size,omitempty"`
	Waist    *int    `json:"waist,omitempty"`
	Hip      *int    `json:"hip,omitempty"`
}

type MultiCriterionInput added in v0.1.0

type MultiCriterionInput interface {
	Count() int
	GetValues() []interface{}
	GetModifier() CriterionModifier
}

type MultiIDCriterionInput added in v0.1.0

type MultiIDCriterionInput struct {
	Value    []uuid.UUID       `json:"value,omitempty"`
	Modifier CriterionModifier `json:"modifier"`
}

func (MultiIDCriterionInput) Count added in v0.1.0

func (i MultiIDCriterionInput) Count() int

func (MultiIDCriterionInput) GetModifier added in v0.1.0

func (i MultiIDCriterionInput) GetModifier() CriterionModifier

func (MultiIDCriterionInput) GetValues added in v0.4.7

func (i MultiIDCriterionInput) GetValues() []interface{}

type MultiStringCriterionInput added in v0.1.0

type MultiStringCriterionInput struct {
	Value    []string          `json:"value"`
	Modifier CriterionModifier `json:"modifier"`
}

func (MultiStringCriterionInput) Count added in v0.1.0

func (i MultiStringCriterionInput) Count() int

func (MultiStringCriterionInput) GetModifier added in v0.1.0

func (MultiStringCriterionInput) GetValues added in v0.4.7

func (i MultiStringCriterionInput) GetValues() []interface{}

type Mutation added in v0.5.1

type Mutation struct {
}

type MutationResolver added in v0.1.0

type MutationResolver interface {
	SceneCreate(ctx context.Context, input SceneCreateInput) (*Scene, error)
	SceneUpdate(ctx context.Context, input SceneUpdateInput) (*Scene, error)
	SceneDestroy(ctx context.Context, input SceneDestroyInput) (bool, error)
	PerformerCreate(ctx context.Context, input PerformerCreateInput) (*Performer, error)
	PerformerUpdate(ctx context.Context, input PerformerUpdateInput) (*Performer, error)
	PerformerDestroy(ctx context.Context, input PerformerDestroyInput) (bool, error)
	StudioCreate(ctx context.Context, input StudioCreateInput) (*Studio, error)
	StudioUpdate(ctx context.Context, input StudioUpdateInput) (*Studio, error)
	StudioDestroy(ctx context.Context, input StudioDestroyInput) (bool, error)
	TagCreate(ctx context.Context, input TagCreateInput) (*Tag, error)
	TagUpdate(ctx context.Context, input TagUpdateInput) (*Tag, error)
	TagDestroy(ctx context.Context, input TagDestroyInput) (bool, error)
	UserCreate(ctx context.Context, input UserCreateInput) (*User, error)
	UserUpdate(ctx context.Context, input UserUpdateInput) (*User, error)
	UserDestroy(ctx context.Context, input UserDestroyInput) (bool, error)
	ImageCreate(ctx context.Context, input ImageCreateInput) (*Image, error)
	ImageDestroy(ctx context.Context, input ImageDestroyInput) (bool, error)
	NewUser(ctx context.Context, input NewUserInput) (*string, error)
	ActivateNewUser(ctx context.Context, input ActivateNewUserInput) (*User, error)
	GenerateInviteCode(ctx context.Context) (*uuid.UUID, error)
	GenerateInviteCodes(ctx context.Context, input *GenerateInviteCodeInput) ([]uuid.UUID, error)
	RescindInviteCode(ctx context.Context, code uuid.UUID) (bool, error)
	GrantInvite(ctx context.Context, input GrantInviteInput) (int, error)
	RevokeInvite(ctx context.Context, input RevokeInviteInput) (int, error)
	TagCategoryCreate(ctx context.Context, input TagCategoryCreateInput) (*TagCategory, error)
	TagCategoryUpdate(ctx context.Context, input TagCategoryUpdateInput) (*TagCategory, error)
	TagCategoryDestroy(ctx context.Context, input TagCategoryDestroyInput) (bool, error)
	SiteCreate(ctx context.Context, input SiteCreateInput) (*Site, error)
	SiteUpdate(ctx context.Context, input SiteUpdateInput) (*Site, error)
	SiteDestroy(ctx context.Context, input SiteDestroyInput) (bool, error)
	RegenerateAPIKey(ctx context.Context, userID *uuid.UUID) (string, error)
	ResetPassword(ctx context.Context, input ResetPasswordInput) (bool, error)
	ChangePassword(ctx context.Context, input UserChangePasswordInput) (bool, error)
	SceneEdit(ctx context.Context, input SceneEditInput) (*Edit, error)
	PerformerEdit(ctx context.Context, input PerformerEditInput) (*Edit, error)
	StudioEdit(ctx context.Context, input StudioEditInput) (*Edit, error)
	TagEdit(ctx context.Context, input TagEditInput) (*Edit, error)
	SceneEditUpdate(ctx context.Context, id uuid.UUID, input SceneEditInput) (*Edit, error)
	PerformerEditUpdate(ctx context.Context, id uuid.UUID, input PerformerEditInput) (*Edit, error)
	StudioEditUpdate(ctx context.Context, id uuid.UUID, input StudioEditInput) (*Edit, error)
	TagEditUpdate(ctx context.Context, id uuid.UUID, input TagEditInput) (*Edit, error)
	EditVote(ctx context.Context, input EditVoteInput) (*Edit, error)
	EditComment(ctx context.Context, input EditCommentInput) (*Edit, error)
	ApplyEdit(ctx context.Context, input ApplyEditInput) (*Edit, error)
	CancelEdit(ctx context.Context, input CancelEditInput) (*Edit, error)
	SubmitFingerprint(ctx context.Context, input FingerprintSubmission) (bool, error)
	SubmitSceneDraft(ctx context.Context, input SceneDraftInput) (*DraftSubmissionStatus, error)
	SubmitPerformerDraft(ctx context.Context, input PerformerDraftInput) (*DraftSubmissionStatus, error)
	DestroyDraft(ctx context.Context, id uuid.UUID) (bool, error)
	FavoritePerformer(ctx context.Context, id uuid.UUID, favorite bool) (bool, error)
	FavoriteStudio(ctx context.Context, id uuid.UUID, favorite bool) (bool, error)
}

type NewUserInput added in v0.1.0

type NewUserInput struct {
	Email     string  `json:"email"`
	InviteKey *string `json:"invite_key,omitempty"`
}

type NotFoundError

type NotFoundError uuid.UUID

NotFoundError indicates that an object with the given id was not found.

func (NotFoundError) Error

func (e NotFoundError) Error() string

type OperationEnum added in v0.1.0

type OperationEnum string
const (
	OperationEnumCreate  OperationEnum = "CREATE"
	OperationEnumModify  OperationEnum = "MODIFY"
	OperationEnumDestroy OperationEnum = "DESTROY"
	OperationEnumMerge   OperationEnum = "MERGE"
)

func (OperationEnum) IsValid added in v0.1.0

func (e OperationEnum) IsValid() bool

func (OperationEnum) MarshalGQL added in v0.1.0

func (e OperationEnum) MarshalGQL(w io.Writer)

func (OperationEnum) String added in v0.1.0

func (e OperationEnum) String() string

func (*OperationEnum) UnmarshalGQL added in v0.1.0

func (e *OperationEnum) UnmarshalGQL(v interface{}) error

type PendingActivation

type PendingActivation struct {
	ID        uuid.UUID     `db:"id" json:"id"`
	Email     string        `db:"email" json:"email"`
	InviteKey uuid.NullUUID `db:"invite_key" json:"invite_key"`
	Type      string        `db:"type" json:"type"`
	Time      time.Time     `db:"time" json:"time"`
}

func (PendingActivation) GetID

func (p PendingActivation) GetID() uuid.UUID

type PendingActivationCreator

type PendingActivationCreator interface {
	Create(newActivation PendingActivation) (*PendingActivation, error)
}

type PendingActivationFinder

type PendingActivationFinder interface {
	Find(id uuid.UUID) (*PendingActivation, error)
	FindByEmail(email string, activationType string) (*PendingActivation, error)
	FindByInviteKey(key string, activationType string) ([]*PendingActivation, error)
}

type PendingActivationRepo

type PendingActivationRepo interface {
	PendingActivationFinder
	PendingActivationCreator

	Destroy(id uuid.UUID) error
	DestroyExpired(expireTime time.Time) error
	Count() (int, error)
}

type PendingActivations

type PendingActivations []*PendingActivation

func (*PendingActivations) Add

func (p *PendingActivations) Add(o interface{})

func (PendingActivations) Each

func (p PendingActivations) Each(fn func(interface{}))

type Performer

type Performer struct {
	ID                uuid.UUID      `db:"id" json:"id"`
	Name              string         `db:"name" json:"name"`
	Disambiguation    sql.NullString `db:"disambiguation" json:"disambiguation"`
	Gender            sql.NullString `db:"gender" json:"gender"`
	Birthdate         SQLDate        `db:"birthdate" json:"birthdate"`
	BirthdateAccuracy sql.NullString `db:"birthdate_accuracy" json:"birthdate_accuracy"`
	Ethnicity         sql.NullString `db:"ethnicity" json:"ethnicity"`
	Country           sql.NullString `db:"country" json:"country"`
	EyeColor          sql.NullString `db:"eye_color" json:"eye_color"`
	HairColor         sql.NullString `db:"hair_color" json:"hair_color"`
	Height            sql.NullInt64  `db:"height" json:"height"`
	CupSize           sql.NullString `db:"cup_size" json:"cup_size"`
	BandSize          sql.NullInt64  `db:"band_size" json:"band_size"`
	WaistSize         sql.NullInt64  `db:"waist_size" json:"waist_size"`
	HipSize           sql.NullInt64  `db:"hip_size" json:"hip_size"`
	BreastType        sql.NullString `db:"breast_type" json:"breast_type"`
	CareerStartYear   sql.NullInt64  `db:"career_start_year" json:"career_start_year"`
	CareerEndYear     sql.NullInt64  `db:"career_end_year" json:"career_end_year"`
	CreatedAt         time.Time      `db:"created_at" json:"created_at"`
	UpdatedAt         time.Time      `db:"updated_at" json:"updated_at"`
	Deleted           bool           `db:"deleted" json:"deleted"`
}

func (*Performer) CopyFromCreateInput

func (p *Performer) CopyFromCreateInput(input PerformerCreateInput) error

func (*Performer) CopyFromPerformerEdit

func (p *Performer) CopyFromPerformerEdit(input PerformerEdit, old PerformerEdit)

func (*Performer) CopyFromUpdateInput

func (p *Performer) CopyFromUpdateInput(input PerformerUpdateInput) error

func (Performer) GetID

func (p Performer) GetID() uuid.UUID

func (*Performer) IsEditTarget

func (p *Performer) IsEditTarget()

func (Performer) IsSceneDraftPerformer added in v0.1.0

func (Performer) IsSceneDraftPerformer()

func (Performer) ResolveBirthdate

func (p Performer) ResolveBirthdate() FuzzyDate

func (Performer) ResolveMeasurements

func (p Performer) ResolveMeasurements() Measurements

func (*Performer) ValidateModifyEdit

func (p *Performer) ValidateModifyEdit(edit PerformerEditData) error

type PerformerAlias

type PerformerAlias struct {
	PerformerID uuid.UUID `db:"performer_id" json:"performer_id"`
	Alias       string    `db:"alias" json:"alias"`
}

func (PerformerAlias) ID

func (p PerformerAlias) ID() string

type PerformerAliases

type PerformerAliases []*PerformerAlias

func CreatePerformerAliases

func CreatePerformerAliases(performerID uuid.UUID, aliases []string) PerformerAliases

func (*PerformerAliases) Add

func (p *PerformerAliases) Add(o interface{})

func (*PerformerAliases) AddAliases

func (p *PerformerAliases) AddAliases(newAliases []*PerformerAlias) error

func (PerformerAliases) Each

func (p PerformerAliases) Each(fn func(interface{}))

func (PerformerAliases) EachPtr

func (p PerformerAliases) EachPtr(fn func(interface{}))

func (*PerformerAliases) Remove

func (p *PerformerAliases) Remove(id string)

func (*PerformerAliases) RemoveAliases

func (p *PerformerAliases) RemoveAliases(oldAliases []string) error

func (PerformerAliases) ToAliases

func (p PerformerAliases) ToAliases() []string

type PerformerAppearance added in v0.1.0

type PerformerAppearance struct {
	Performer *Performer `json:"performer"`
	// Performing as alias
	As *string `json:"as,omitempty"`
}

type PerformerAppearanceInput added in v0.1.0

type PerformerAppearanceInput struct {
	PerformerID uuid.UUID `json:"performer_id"`
	// Performing as alias
	As *string `json:"as,omitempty"`
}

type PerformerBodyMod

type PerformerBodyMod struct {
	PerformerID uuid.UUID      `db:"performer_id" json:"performer_id"`
	Location    string         `db:"location" json:"location"`
	Description sql.NullString `db:"description" json:"description"`
}

func (PerformerBodyMod) ID

func (m PerformerBodyMod) ID() string

func (PerformerBodyMod) ToBodyModification

func (m PerformerBodyMod) ToBodyModification() BodyModification

type PerformerBodyMods

type PerformerBodyMods []*PerformerBodyMod

func CreatePerformerBodyMods

func CreatePerformerBodyMods(performerID uuid.UUID, urls []*BodyModification) PerformerBodyMods

func (*PerformerBodyMods) Add

func (p *PerformerBodyMods) Add(o interface{})

func (PerformerBodyMods) Each

func (p PerformerBodyMods) Each(fn func(interface{}))

func (PerformerBodyMods) EachPtr

func (p PerformerBodyMods) EachPtr(fn func(interface{}))

func (*PerformerBodyMods) Remove

func (p *PerformerBodyMods) Remove(id string)

func (PerformerBodyMods) ToBodyModifications

func (p PerformerBodyMods) ToBodyModifications() []*BodyModification

type PerformerCreateInput added in v0.1.0

type PerformerCreateInput struct {
	Name            string              `json:"name"`
	Disambiguation  *string             `json:"disambiguation,omitempty"`
	Aliases         []string            `json:"aliases,omitempty"`
	Gender          *GenderEnum         `json:"gender,omitempty"`
	Urls            []*URLInput         `json:"urls,omitempty"`
	Birthdate       *string             `json:"birthdate,omitempty"`
	Ethnicity       *EthnicityEnum      `json:"ethnicity,omitempty"`
	Country         *string             `json:"country,omitempty"`
	EyeColor        *EyeColorEnum       `json:"eye_color,omitempty"`
	HairColor       *HairColorEnum      `json:"hair_color,omitempty"`
	Height          *int                `json:"height,omitempty"`
	CupSize         *string             `json:"cup_size,omitempty"`
	BandSize        *int                `json:"band_size,omitempty"`
	WaistSize       *int                `json:"waist_size,omitempty"`
	HipSize         *int                `json:"hip_size,omitempty"`
	BreastType      *BreastTypeEnum     `json:"breast_type,omitempty"`
	CareerStartYear *int                `json:"career_start_year,omitempty"`
	CareerEndYear   *int                `json:"career_end_year,omitempty"`
	Tattoos         []*BodyModification `json:"tattoos,omitempty"`
	Piercings       []*BodyModification `json:"piercings,omitempty"`
	ImageIds        []uuid.UUID         `json:"image_ids,omitempty"`
	DraftID         *uuid.UUID          `json:"draft_id,omitempty"`
}

type PerformerDestroyInput added in v0.1.0

type PerformerDestroyInput struct {
	ID uuid.UUID `json:"id"`
}

type PerformerDraft added in v0.1.0

type PerformerDraft struct {
	ID              *uuid.UUID `json:"id,omitempty"`
	Name            string     `json:"name"`
	Disambiguation  *string    `json:"disambiguation,omitempty"`
	Aliases         *string    `json:"aliases,omitempty"`
	Gender          *string    `json:"gender,omitempty"`
	Birthdate       *string    `json:"birthdate,omitempty"`
	Urls            []string   `json:"urls,omitempty"`
	Ethnicity       *string    `json:"ethnicity,omitempty"`
	Country         *string    `json:"country,omitempty"`
	EyeColor        *string    `json:"eye_color,omitempty"`
	HairColor       *string    `json:"hair_color,omitempty"`
	Height          *string    `json:"height,omitempty"`
	Measurements    *string    `json:"measurements,omitempty"`
	BreastType      *string    `json:"breast_type,omitempty"`
	Tattoos         *string    `json:"tattoos,omitempty"`
	Piercings       *string    `json:"piercings,omitempty"`
	CareerStartYear *int       `json:"career_start_year,omitempty"`
	CareerEndYear   *int       `json:"career_end_year,omitempty"`
	Image           *uuid.UUID `json:"image,omitempty"`
}

func (PerformerDraft) IsDraftData added in v0.1.0

func (PerformerDraft) IsDraftData()

type PerformerDraftInput added in v0.1.0

type PerformerDraftInput struct {
	ID              *uuid.UUID      `json:"id,omitempty"`
	Disambiguation  *string         `json:"disambiguation,omitempty"`
	Name            string          `json:"name"`
	Aliases         *string         `json:"aliases,omitempty"`
	Gender          *string         `json:"gender,omitempty"`
	Birthdate       *string         `json:"birthdate,omitempty"`
	Urls            []string        `json:"urls,omitempty"`
	Ethnicity       *string         `json:"ethnicity,omitempty"`
	Country         *string         `json:"country,omitempty"`
	EyeColor        *string         `json:"eye_color,omitempty"`
	HairColor       *string         `json:"hair_color,omitempty"`
	Height          *string         `json:"height,omitempty"`
	Measurements    *string         `json:"measurements,omitempty"`
	BreastType      *string         `json:"breast_type,omitempty"`
	Tattoos         *string         `json:"tattoos,omitempty"`
	Piercings       *string         `json:"piercings,omitempty"`
	CareerStartYear *int            `json:"career_start_year,omitempty"`
	CareerEndYear   *int            `json:"career_end_year,omitempty"`
	Image           *graphql.Upload `json:"image,omitempty"`
}

type PerformerDraftResolver added in v0.1.0

type PerformerDraftResolver interface {
	Image(ctx context.Context, obj *PerformerDraft) (*Image, error)
}

type PerformerEdit

type PerformerEdit struct {
	EditID            uuid.UUID           `json:"-"`
	Name              *string             `json:"name,omitempty"`
	Disambiguation    *string             `json:"disambiguation,omitempty"`
	AddedAliases      []string            `json:"added_aliases,omitempty"`
	RemovedAliases    []string            `json:"removed_aliases,omitempty"`
	Gender            *string             `json:"gender,omitempty"`
	AddedUrls         []*URL              `json:"added_urls,omitempty"`
	RemovedUrls       []*URL              `json:"removed_urls,omitempty"`
	Birthdate         *string             `json:"birthdate,omitempty"`
	BirthdateAccuracy *string             `json:"birthdate_accuracy,omitempty"`
	Ethnicity         *string             `json:"ethnicity,omitempty"`
	Country           *string             `json:"country,omitempty"`
	EyeColor          *string             `json:"eye_color,omitempty"`
	HairColor         *string             `json:"hair_color,omitempty"`
	Height            *int64              `json:"height,omitempty"`
	CupSize           *string             `json:"cup_size,omitempty"`
	BandSize          *int64              `json:"band_size,omitempty"`
	WaistSize         *int64              `json:"waist_size,omitempty"`
	HipSize           *int64              `json:"hip_size,omitempty"`
	BreastType        *string             `json:"breast_type,omitempty"`
	CareerStartYear   *int64              `json:"career_start_year,omitempty"`
	CareerEndYear     *int64              `json:"career_end_year,omitempty"`
	AddedTattoos      []*BodyModification `json:"added_tattoos,omitempty"`
	RemovedTattoos    []*BodyModification `json:"removed_tattoos,omitempty"`
	AddedPiercings    []*BodyModification `json:"added_piercings,omitempty"`
	RemovedPiercings  []*BodyModification `json:"removed_piercings,omitempty"`
	AddedImages       []uuid.UUID         `json:"added_images,omitempty"`
	RemovedImages     []uuid.UUID         `json:"removed_images,omitempty"`
	DraftID           *uuid.UUID          `json:"draft_id,omitempty"`
}

func (PerformerEdit) IsEditDetails

func (PerformerEdit) IsEditDetails()

type PerformerEditData

type PerformerEditData struct {
	New              *PerformerEdit `json:"new_data,omitempty"`
	Old              *PerformerEdit `json:"old_data,omitempty"`
	MergeSources     []uuid.UUID    `json:"merge_sources,omitempty"`
	SetModifyAliases bool           `json:"modify_aliases,omitempty"`
	SetMergeAliases  bool           `json:"merge_aliases,omitempty"`
}

type PerformerEditDetailsInput added in v0.1.0

type PerformerEditDetailsInput struct {
	Name            *string             `json:"name,omitempty"`
	Disambiguation  *string             `json:"disambiguation,omitempty"`
	Aliases         []string            `json:"aliases,omitempty"`
	Gender          *GenderEnum         `json:"gender,omitempty"`
	Urls            []*URLInput         `json:"urls,omitempty"`
	Birthdate       *string             `json:"birthdate,omitempty"`
	Ethnicity       *EthnicityEnum      `json:"ethnicity,omitempty"`
	Country         *string             `json:"country,omitempty"`
	EyeColor        *EyeColorEnum       `json:"eye_color,omitempty"`
	HairColor       *HairColorEnum      `json:"hair_color,omitempty"`
	Height          *int                `json:"height,omitempty"`
	CupSize         *string             `json:"cup_size,omitempty"`
	BandSize        *int                `json:"band_size,omitempty"`
	WaistSize       *int                `json:"waist_size,omitempty"`
	HipSize         *int                `json:"hip_size,omitempty"`
	BreastType      *BreastTypeEnum     `json:"breast_type,omitempty"`
	CareerStartYear *int                `json:"career_start_year,omitempty"`
	CareerEndYear   *int                `json:"career_end_year,omitempty"`
	Tattoos         []*BodyModification `json:"tattoos,omitempty"`
	Piercings       []*BodyModification `json:"piercings,omitempty"`
	ImageIds        []uuid.UUID         `json:"image_ids,omitempty"`
	DraftID         *uuid.UUID          `json:"draft_id,omitempty"`
}

func (PerformerEditDetailsInput) PerformerEditFromCreate added in v0.1.0

func (e PerformerEditDetailsInput) PerformerEditFromCreate(inputArgs utils.ArgumentsQuery) (*PerformerEditData, error)

func (PerformerEditDetailsInput) PerformerEditFromDiff added in v0.1.0

func (e PerformerEditDetailsInput) PerformerEditFromDiff(orig Performer, inputArgs utils.ArgumentsQuery) (*PerformerEditData, error)

func (PerformerEditDetailsInput) PerformerEditFromMerge added in v0.1.0

func (e PerformerEditDetailsInput) PerformerEditFromMerge(orig Performer, sources []uuid.UUID, inputArgs utils.ArgumentsQuery) (*PerformerEditData, error)

type PerformerEditInput added in v0.1.0

type PerformerEditInput struct {
	Edit *EditInput `json:"edit"`
	// Not required for destroy type
	Details *PerformerEditDetailsInput `json:"details,omitempty"`
	// Controls aliases modification for merges and name modifications
	Options *PerformerEditOptionsInput `json:"options,omitempty"`
}

type PerformerEditOptions added in v0.1.0

type PerformerEditOptions struct {
	// Set performer alias on scenes without alias to old name if name is changed
	SetModifyAliases bool `json:"set_modify_aliases"`
	// Set performer alias on scenes attached to merge sources to old name
	SetMergeAliases bool `json:"set_merge_aliases"`
}

type PerformerEditOptionsInput added in v0.1.0

type PerformerEditOptionsInput struct {
	// Set performer alias on scenes without alias to old name if name is changed
	SetModifyAliases *bool `json:"set_modify_aliases,omitempty"`
	// Set performer alias on scenes attached to merge sources to old name
	SetMergeAliases *bool `json:"set_merge_aliases,omitempty"`
}

type PerformerEditResolver added in v0.1.0

type PerformerEditResolver interface {
	Gender(ctx context.Context, obj *PerformerEdit) (*GenderEnum, error)

	Birthdate(ctx context.Context, obj *PerformerEdit) (*string, error)
	Ethnicity(ctx context.Context, obj *PerformerEdit) (*EthnicityEnum, error)

	EyeColor(ctx context.Context, obj *PerformerEdit) (*EyeColorEnum, error)
	HairColor(ctx context.Context, obj *PerformerEdit) (*HairColorEnum, error)

	BreastType(ctx context.Context, obj *PerformerEdit) (*BreastTypeEnum, error)

	AddedImages(ctx context.Context, obj *PerformerEdit) ([]*Image, error)
	RemovedImages(ctx context.Context, obj *PerformerEdit) ([]*Image, error)

	Aliases(ctx context.Context, obj *PerformerEdit) ([]string, error)
	Urls(ctx context.Context, obj *PerformerEdit) ([]*URL, error)
	Images(ctx context.Context, obj *PerformerEdit) ([]*Image, error)
	Tattoos(ctx context.Context, obj *PerformerEdit) ([]*BodyModification, error)
	Piercings(ctx context.Context, obj *PerformerEdit) ([]*BodyModification, error)
}

type PerformerFavorite added in v0.1.0

type PerformerFavorite struct {
	PerformerID uuid.UUID `db:"performer_id" json:"performer_id"`
	UserID      uuid.UUID `db:"user_id" json:"user_id"`
}

type PerformerImage

type PerformerImage struct {
	PerformerID uuid.UUID `db:"performer_id" json:"performer_id"`
	ImageID     uuid.UUID `db:"image_id" json:"image_id"`
}

func (PerformerImage) ID

func (p PerformerImage) ID() string

type PerformerQuery added in v0.1.0

type PerformerQuery struct {
	Filter PerformerQueryInput
}

type PerformerQueryInput added in v0.1.6

type PerformerQueryInput struct {
	// Searches name and disambiguation - assumes like query unless quoted
	Names *string `json:"names,omitempty"`
	// Searches name only - assumes like query unless quoted
	Name *string `json:"name,omitempty"`
	// Search aliases only - assumes like query unless quoted
	Alias          *string               `json:"alias,omitempty"`
	Disambiguation *StringCriterionInput `json:"disambiguation,omitempty"`
	Gender         *GenderFilterEnum     `json:"gender,omitempty"`
	// Filter to search urls - assumes like query unless quoted
	URL             *string                         `json:"url,omitempty"`
	Birthdate       *DateCriterionInput             `json:"birthdate,omitempty"`
	BirthYear       *IntCriterionInput              `json:"birth_year,omitempty"`
	Age             *IntCriterionInput              `json:"age,omitempty"`
	Ethnicity       *EthnicityFilterEnum            `json:"ethnicity,omitempty"`
	Country         *StringCriterionInput           `json:"country,omitempty"`
	EyeColor        *EyeColorCriterionInput         `json:"eye_color,omitempty"`
	HairColor       *HairColorCriterionInput        `json:"hair_color,omitempty"`
	Height          *IntCriterionInput              `json:"height,omitempty"`
	CupSize         *StringCriterionInput           `json:"cup_size,omitempty"`
	BandSize        *IntCriterionInput              `json:"band_size,omitempty"`
	WaistSize       *IntCriterionInput              `json:"waist_size,omitempty"`
	HipSize         *IntCriterionInput              `json:"hip_size,omitempty"`
	BreastType      *BreastTypeCriterionInput       `json:"breast_type,omitempty"`
	CareerStartYear *IntCriterionInput              `json:"career_start_year,omitempty"`
	CareerEndYear   *IntCriterionInput              `json:"career_end_year,omitempty"`
	Tattoos         *BodyModificationCriterionInput `json:"tattoos,omitempty"`
	Piercings       *BodyModificationCriterionInput `json:"piercings,omitempty"`
	// Filter by performerfavorite status for the current user
	IsFavorite *bool `json:"is_favorite,omitempty"`
	// Filter by a performer they have performed in scenes with
	PerformedWith *uuid.UUID `json:"performed_with,omitempty"`
	// Filter by a studio
	StudioID  *uuid.UUID        `json:"studio_id,omitempty"`
	Page      int               `json:"page"`
	PerPage   int               `json:"per_page"`
	Direction SortDirectionEnum `json:"direction"`
	Sort      PerformerSortEnum `json:"sort"`
}

type PerformerRepo

type PerformerRepo interface {
	Create(newPerformer Performer) (*Performer, error)
	Update(updatedPerformer Performer) (*Performer, error)
	UpdatePartial(updatedPerformer Performer) (*Performer, error)
	Destroy(id uuid.UUID) error
	CreateAliases(newJoins PerformerAliases) error
	UpdateAliases(performerID uuid.UUID, updatedJoins PerformerAliases) error
	CreateUrls(newJoins PerformerURLs) error
	UpdateUrls(performerID uuid.UUID, updatedJoins PerformerURLs) error
	CreateTattoos(newJoins PerformerBodyMods) error
	UpdateTattoos(performerID uuid.UUID, updatedJoins PerformerBodyMods) error
	CreatePiercings(newJoins PerformerBodyMods) error
	UpdatePiercings(performerID uuid.UUID, updatedJoins PerformerBodyMods) error
	Find(id uuid.UUID) (*Performer, error)
	FindByIds(ids []uuid.UUID) ([]*Performer, []error)
	FindWithRedirect(id uuid.UUID) (*Performer, error)
	Count() (int, error)
	QueryPerformers(filter PerformerQueryInput, userID uuid.UUID) ([]*Performer, error)
	QueryCount(filter PerformerQueryInput, userID uuid.UUID) (int, error)
	GetAliases(id uuid.UUID) (PerformerAliases, error)
	GetImages(id uuid.UUID) (PerformersImages, error)
	GetAllAliases(ids []uuid.UUID) ([][]string, []error)
	GetURLs(id uuid.UUID) ([]*URL, error)
	GetAllURLs(ids []uuid.UUID) ([][]*URL, []error)
	GetTattoos(id uuid.UUID) (PerformerBodyMods, error)
	GetAllTattoos(ids []uuid.UUID) ([][]*BodyModification, []error)
	GetPiercings(id uuid.UUID) (PerformerBodyMods, error)
	GetAllPiercings(ids []uuid.UUID) ([][]*BodyModification, []error)
	SearchPerformers(term string, limit int) (Performers, error)
	ApplyEdit(performer *Performer, create bool, data *PerformerEditData) (*Performer, error)
	FindMergeIDsByPerformerIDs(ids []uuid.UUID) ([][]uuid.UUID, []error)
	SoftDelete(performer Performer) (*Performer, error)
	MergeInto(source *Performer, target *Performer, setAlias bool) error
	DeleteScenePerformers(id uuid.UUID) error
	DeletePerformerFavorites(id uuid.UUID) error
	GetEditURLs(id *uuid.UUID, data *PerformerEdit) ([]*URL, error)
	GetEditImages(id *uuid.UUID, data *PerformerEdit) ([]uuid.UUID, error)
	GetEditAliases(id *uuid.UUID, data *PerformerEdit) ([]string, error)
	GetEditTattoos(id *uuid.UUID, data *PerformerEdit) ([]*BodyModification, error)
	GetEditPiercings(id *uuid.UUID, data *PerformerEdit) ([]*BodyModification, error)
	IsFavoriteByIds(userID uuid.UUID, ids []uuid.UUID) ([]bool, []error)
}

type PerformerResolver added in v0.1.0

type PerformerResolver interface {
	Disambiguation(ctx context.Context, obj *Performer) (*string, error)
	Aliases(ctx context.Context, obj *Performer) ([]string, error)
	Gender(ctx context.Context, obj *Performer) (*GenderEnum, error)
	Urls(ctx context.Context, obj *Performer) ([]*URL, error)
	Birthdate(ctx context.Context, obj *Performer) (*FuzzyDate, error)
	BirthDate(ctx context.Context, obj *Performer) (*string, error)
	Age(ctx context.Context, obj *Performer) (*int, error)
	Ethnicity(ctx context.Context, obj *Performer) (*EthnicityEnum, error)
	Country(ctx context.Context, obj *Performer) (*string, error)
	EyeColor(ctx context.Context, obj *Performer) (*EyeColorEnum, error)
	HairColor(ctx context.Context, obj *Performer) (*HairColorEnum, error)
	Height(ctx context.Context, obj *Performer) (*int, error)
	Measurements(ctx context.Context, obj *Performer) (*Measurements, error)
	CupSize(ctx context.Context, obj *Performer) (*string, error)
	BandSize(ctx context.Context, obj *Performer) (*int, error)
	WaistSize(ctx context.Context, obj *Performer) (*int, error)
	HipSize(ctx context.Context, obj *Performer) (*int, error)
	BreastType(ctx context.Context, obj *Performer) (*BreastTypeEnum, error)
	CareerStartYear(ctx context.Context, obj *Performer) (*int, error)
	CareerEndYear(ctx context.Context, obj *Performer) (*int, error)
	Tattoos(ctx context.Context, obj *Performer) ([]*BodyModification, error)
	Piercings(ctx context.Context, obj *Performer) ([]*BodyModification, error)
	Images(ctx context.Context, obj *Performer) ([]*Image, error)

	Edits(ctx context.Context, obj *Performer) ([]*Edit, error)
	SceneCount(ctx context.Context, obj *Performer) (int, error)
	Scenes(ctx context.Context, obj *Performer, input *PerformerScenesInput) ([]*Scene, error)
	MergedIds(ctx context.Context, obj *Performer) ([]uuid.UUID, error)
	Studios(ctx context.Context, obj *Performer) ([]*PerformerStudio, error)
	IsFavorite(ctx context.Context, obj *Performer) (bool, error)
	Created(ctx context.Context, obj *Performer) (*time.Time, error)
	Updated(ctx context.Context, obj *Performer) (*time.Time, error)
}

type PerformerScene

type PerformerScene struct {
	PerformerID uuid.UUID      `db:"performer_id" json:"performer_id"`
	As          sql.NullString `db:"as" json:"as"`
	SceneID     uuid.UUID      `db:"scene_id" json:"scene_id"`
}

func (PerformerScene) ID added in v0.1.0

func (s PerformerScene) ID() string

type PerformerScenesInput added in v0.4.0

type PerformerScenesInput struct {
	// Filter by another performer that also performs in the scenes
	PerformedWith *uuid.UUID `json:"performed_with,omitempty"`
	// Filter by a studio
	StudioID *uuid.UUID `json:"studio_id,omitempty"`
	// Filter by tags
	Tags *MultiIDCriterionInput `json:"tags,omitempty"`
}

type PerformerSortEnum added in v0.1.6

type PerformerSortEnum string
const (
	PerformerSortEnumName            PerformerSortEnum = "NAME"
	PerformerSortEnumBirthdate       PerformerSortEnum = "BIRTHDATE"
	PerformerSortEnumSceneCount      PerformerSortEnum = "SCENE_COUNT"
	PerformerSortEnumCareerStartYear PerformerSortEnum = "CAREER_START_YEAR"
	PerformerSortEnumDebut           PerformerSortEnum = "DEBUT"
	PerformerSortEnumLastScene       PerformerSortEnum = "LAST_SCENE"
	PerformerSortEnumCreatedAt       PerformerSortEnum = "CREATED_AT"
	PerformerSortEnumUpdatedAt       PerformerSortEnum = "UPDATED_AT"
)

func (PerformerSortEnum) IsValid added in v0.1.6

func (e PerformerSortEnum) IsValid() bool

func (PerformerSortEnum) MarshalGQL added in v0.1.6

func (e PerformerSortEnum) MarshalGQL(w io.Writer)

func (PerformerSortEnum) String added in v0.1.6

func (e PerformerSortEnum) String() string

func (*PerformerSortEnum) UnmarshalGQL added in v0.1.6

func (e *PerformerSortEnum) UnmarshalGQL(v interface{}) error

type PerformerStudio

type PerformerStudio struct {
	SceneCount int `db:"count" json:"scene_count"`
	Studio
}

type PerformerURL

type PerformerURL struct {
	PerformerID uuid.UUID `db:"performer_id" json:"performer_id"`
	SiteID      uuid.UUID `db:"site_id" json:"site_id"`
	URL         string    `db:"url" json:"url"`
}

func (PerformerURL) ID

func (p PerformerURL) ID() string

func (*PerformerURL) ToURL

func (p *PerformerURL) ToURL() URL

type PerformerURLs

type PerformerURLs []*PerformerURL

func CreatePerformerURLs

func CreatePerformerURLs(performerID uuid.UUID, urls []*URL) PerformerURLs

func (*PerformerURLs) Add

func (p *PerformerURLs) Add(o interface{})

func (PerformerURLs) Each

func (p PerformerURLs) Each(fn func(interface{}))

func (PerformerURLs) EachPtr

func (p PerformerURLs) EachPtr(fn func(interface{}))

func (*PerformerURLs) Remove

func (p *PerformerURLs) Remove(id string)

type PerformerUpdateInput added in v0.1.0

type PerformerUpdateInput struct {
	ID              uuid.UUID           `json:"id"`
	Name            *string             `json:"name,omitempty"`
	Disambiguation  *string             `json:"disambiguation,omitempty"`
	Aliases         []string            `json:"aliases,omitempty"`
	Gender          *GenderEnum         `json:"gender,omitempty"`
	Urls            []*URLInput         `json:"urls,omitempty"`
	Birthdate       *string             `json:"birthdate,omitempty"`
	Ethnicity       *EthnicityEnum      `json:"ethnicity,omitempty"`
	Country         *string             `json:"country,omitempty"`
	EyeColor        *EyeColorEnum       `json:"eye_color,omitempty"`
	HairColor       *HairColorEnum      `json:"hair_color,omitempty"`
	Height          *int                `json:"height,omitempty"`
	CupSize         *string             `json:"cup_size,omitempty"`
	BandSize        *int                `json:"band_size,omitempty"`
	WaistSize       *int                `json:"waist_size,omitempty"`
	HipSize         *int                `json:"hip_size,omitempty"`
	BreastType      *BreastTypeEnum     `json:"breast_type,omitempty"`
	CareerStartYear *int                `json:"career_start_year,omitempty"`
	CareerEndYear   *int                `json:"career_end_year,omitempty"`
	Tattoos         []*BodyModification `json:"tattoos,omitempty"`
	Piercings       []*BodyModification `json:"piercings,omitempty"`
	ImageIds        []uuid.UUID         `json:"image_ids,omitempty"`
}

type Performers

type Performers []*Performer

func (*Performers) Add

func (p *Performers) Add(o interface{})

func (Performers) Each

func (p Performers) Each(fn func(interface{}))

type PerformersImages

type PerformersImages []*PerformerImage

func CreatePerformerImages

func CreatePerformerImages(performerID uuid.UUID, imageIds []uuid.UUID) PerformersImages

func (*PerformersImages) Add

func (p *PerformersImages) Add(o interface{})

func (PerformersImages) Each

func (p PerformersImages) Each(fn func(interface{}))

func (PerformersImages) EachPtr

func (p PerformersImages) EachPtr(fn func(interface{}))

func (*PerformersImages) Remove

func (p *PerformersImages) Remove(id string)

type PerformersScenes

type PerformersScenes []*PerformerScene

func CreateScenePerformers

func CreateScenePerformers(sceneID uuid.UUID, appearances []*PerformerAppearanceInput) PerformersScenes

func (*PerformersScenes) Add

func (p *PerformersScenes) Add(o interface{})

func (PerformersScenes) Each

func (p PerformersScenes) Each(fn func(interface{}))

func (PerformersScenes) EachPtr added in v0.1.0

func (p PerformersScenes) EachPtr(fn func(interface{}))

func (*PerformersScenes) Remove added in v0.1.0

func (p *PerformersScenes) Remove(id string)

type Query added in v0.5.1

type Query struct {
}

The query root for this schema

type QueryEditsResultTypeResolver added in v0.1.0

type QueryEditsResultTypeResolver interface {
	Count(ctx context.Context, obj *EditQuery) (int, error)
	Edits(ctx context.Context, obj *EditQuery) ([]*Edit, error)
}

type QueryExistingSceneInput added in v0.3.0

type QueryExistingSceneInput struct {
	Title        *string             `json:"title,omitempty"`
	StudioID     *uuid.UUID          `json:"studio_id,omitempty"`
	Fingerprints []*FingerprintInput `json:"fingerprints"`
}

type QueryExistingSceneResult added in v0.3.0

type QueryExistingSceneResult struct {
	Input QueryExistingSceneInput
}

type QueryExistingSceneResultResolver added in v0.3.0

type QueryExistingSceneResultResolver interface {
	Edits(ctx context.Context, obj *QueryExistingSceneResult) ([]*Edit, error)
	Scenes(ctx context.Context, obj *QueryExistingSceneResult) ([]*Scene, error)
}

type QueryPerformersResultTypeResolver added in v0.1.0

type QueryPerformersResultTypeResolver interface {
	Count(ctx context.Context, obj *PerformerQuery) (int, error)
	Performers(ctx context.Context, obj *PerformerQuery) ([]*Performer, error)
}

type QueryResolver added in v0.1.0

type QueryResolver interface {
	FindPerformer(ctx context.Context, id uuid.UUID) (*Performer, error)
	QueryPerformers(ctx context.Context, input PerformerQueryInput) (*PerformerQuery, error)
	FindStudio(ctx context.Context, id *uuid.UUID, name *string) (*Studio, error)
	QueryStudios(ctx context.Context, input StudioQueryInput) (*QueryStudiosResultType, error)
	FindTag(ctx context.Context, id *uuid.UUID, name *string) (*Tag, error)
	QueryTags(ctx context.Context, input TagQueryInput) (*QueryTagsResultType, error)
	FindTagCategory(ctx context.Context, id uuid.UUID) (*TagCategory, error)
	QueryTagCategories(ctx context.Context) (*QueryTagCategoriesResultType, error)
	FindScene(ctx context.Context, id uuid.UUID) (*Scene, error)
	FindSceneByFingerprint(ctx context.Context, fingerprint FingerprintQueryInput) ([]*Scene, error)
	FindScenesByFingerprints(ctx context.Context, fingerprints []string) ([]*Scene, error)
	FindScenesByFullFingerprints(ctx context.Context, fingerprints []*FingerprintQueryInput) ([]*Scene, error)
	FindScenesBySceneFingerprints(ctx context.Context, fingerprints [][]*FingerprintQueryInput) ([][]*Scene, error)
	QueryScenes(ctx context.Context, input SceneQueryInput) (*SceneQuery, error)
	FindSite(ctx context.Context, id uuid.UUID) (*Site, error)
	QuerySites(ctx context.Context) (*QuerySitesResultType, error)
	FindEdit(ctx context.Context, id uuid.UUID) (*Edit, error)
	QueryEdits(ctx context.Context, input EditQueryInput) (*EditQuery, error)
	FindUser(ctx context.Context, id *uuid.UUID, username *string) (*User, error)
	QueryUsers(ctx context.Context, input UserQueryInput) (*QueryUsersResultType, error)
	Me(ctx context.Context) (*User, error)
	SearchPerformer(ctx context.Context, term string, limit *int) ([]*Performer, error)
	SearchScene(ctx context.Context, term string, limit *int) ([]*Scene, error)
	SearchTag(ctx context.Context, term string, limit *int) ([]*Tag, error)
	FindDraft(ctx context.Context, id uuid.UUID) (*Draft, error)
	FindDrafts(ctx context.Context) ([]*Draft, error)
	QueryExistingScene(ctx context.Context, input QueryExistingSceneInput) (*QueryExistingSceneResult, error)
	Version(ctx context.Context) (*Version, error)
	GetConfig(ctx context.Context) (*StashBoxConfig, error)
}

type QueryScenesResultTypeResolver added in v0.1.0

type QueryScenesResultTypeResolver interface {
	Count(ctx context.Context, obj *SceneQuery) (int, error)
	Scenes(ctx context.Context, obj *SceneQuery) ([]*Scene, error)
}

type QuerySitesResultType added in v0.1.0

type QuerySitesResultType struct {
	Count int     `json:"count"`
	Sites []*Site `json:"sites"`
}

type QueryStudiosResultType added in v0.1.0

type QueryStudiosResultType struct {
	Count   int       `json:"count"`
	Studios []*Studio `json:"studios"`
}

type QueryTagCategoriesResultType added in v0.1.0

type QueryTagCategoriesResultType struct {
	Count         int            `json:"count"`
	TagCategories []*TagCategory `json:"tag_categories"`
}

type QueryTagsResultType added in v0.1.0

type QueryTagsResultType struct {
	Count int    `json:"count"`
	Tags  []*Tag `json:"tags"`
}

type QueryUsersResultType added in v0.1.0

type QueryUsersResultType struct {
	Count int     `json:"count"`
	Users []*User `json:"users"`
}

type Redirect added in v0.1.0

type Redirect struct {
	SourceID uuid.UUID `db:"source_id" json:"source_id"`
	TargetID uuid.UUID `db:"target_id" json:"target_id"`
}

type Redirects added in v0.1.0

type Redirects []*Redirect

func (*Redirects) Add added in v0.1.0

func (p *Redirects) Add(o interface{})

func (Redirects) Each added in v0.1.0

func (p Redirects) Each(fn func(interface{}))

type Repo

type Repo interface {
	txn.State

	Image() ImageRepo

	Performer() PerformerRepo
	Scene() SceneRepo
	Studio() StudioRepo

	TagCategory() TagCategoryRepo
	Tag() TagRepo

	Edit() EditRepo

	Joins() JoinsRepo

	PendingActivation() PendingActivationRepo
	Invite() InviteKeyRepo
	User() UserRepo
	Site() SiteRepo
	Draft() DraftRepo
}

type ResetPasswordInput added in v0.1.0

type ResetPasswordInput struct {
	Email string `json:"email"`
}

type ResolverRoot added in v0.1.0

type ResolverRoot interface {
	Draft() DraftResolver
	Edit() EditResolver
	EditComment() EditCommentResolver
	EditVote() EditVoteResolver
	Image() ImageResolver
	Mutation() MutationResolver
	Performer() PerformerResolver
	PerformerDraft() PerformerDraftResolver
	PerformerEdit() PerformerEditResolver
	Query() QueryResolver
	QueryEditsResultType() QueryEditsResultTypeResolver
	QueryExistingSceneResult() QueryExistingSceneResultResolver
	QueryPerformersResultType() QueryPerformersResultTypeResolver
	QueryScenesResultType() QueryScenesResultTypeResolver
	Scene() SceneResolver
	SceneDraft() SceneDraftResolver
	SceneEdit() SceneEditResolver
	Site() SiteResolver
	Studio() StudioResolver
	StudioEdit() StudioEditResolver
	Tag() TagResolver
	TagCategory() TagCategoryResolver
	TagEdit() TagEditResolver
	URL() URLResolver
	User() UserResolver
}

type RevokeInviteInput added in v0.1.0

type RevokeInviteInput struct {
	UserID uuid.UUID `json:"user_id"`
	Amount int       `json:"amount"`
}

type RoleCriterionInput added in v0.1.0

type RoleCriterionInput struct {
	Value    []RoleEnum        `json:"value"`
	Modifier CriterionModifier `json:"modifier"`
}

type RoleEnum added in v0.1.0

type RoleEnum string
const (
	RoleEnumRead   RoleEnum = "READ"
	RoleEnumVote   RoleEnum = "VOTE"
	RoleEnumEdit   RoleEnum = "EDIT"
	RoleEnumModify RoleEnum = "MODIFY"
	RoleEnumAdmin  RoleEnum = "ADMIN"
	// May generate invites without tokens
	RoleEnumInvite RoleEnum = "INVITE"
	// May grant and rescind invite tokens and resind invite keys
	RoleEnumManageInvites RoleEnum = "MANAGE_INVITES"
	RoleEnumBot           RoleEnum = "BOT"
)

func (RoleEnum) Implies added in v0.1.0

func (r RoleEnum) Implies(other RoleEnum) bool

func (RoleEnum) IsValid added in v0.1.0

func (e RoleEnum) IsValid() bool

func (RoleEnum) MarshalGQL added in v0.1.0

func (e RoleEnum) MarshalGQL(w io.Writer)

func (RoleEnum) String added in v0.1.0

func (e RoleEnum) String() string

func (*RoleEnum) UnmarshalGQL added in v0.1.0

func (e *RoleEnum) UnmarshalGQL(v interface{}) error

type SQLDate added in v0.2.0

type SQLDate struct {
	String string
	Valid  bool
}

func ParseFuzzyString added in v0.2.0

func ParseFuzzyString(date *string) (SQLDate, sql.NullString, error)

func (SQLDate) IsValid added in v0.2.0

func (t SQLDate) IsValid() bool

func (*SQLDate) Scan added in v0.2.0

func (t *SQLDate) Scan(value interface{}) error

Scan implements the Scanner interface.

func (SQLDate) Value added in v0.2.0

func (t SQLDate) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Scene

type Scene struct {
	ID           uuid.UUID      `db:"id" json:"id"`
	Title        sql.NullString `db:"title" json:"title"`
	Details      sql.NullString `db:"details" json:"details"`
	Date         SQLDate        `db:"date" json:"date"`
	DateAccuracy sql.NullString `db:"date_accuracy" json:"date_accuracy"`
	StudioID     uuid.NullUUID  `db:"studio_id,omitempty" json:"studio_id"`
	CreatedAt    time.Time      `db:"created_at" json:"created_at"`
	UpdatedAt    time.Time      `db:"updated_at" json:"updated_at"`
	Duration     sql.NullInt64  `db:"duration" json:"duration"`
	Director     sql.NullString `db:"director" json:"director"`
	Code         sql.NullString `db:"code" json:"code"`
	Deleted      bool           `db:"deleted" json:"deleted"`
}

func (*Scene) CopyFromCreateInput

func (p *Scene) CopyFromCreateInput(input SceneCreateInput) error

func (*Scene) CopyFromSceneEdit added in v0.1.0

func (p *Scene) CopyFromSceneEdit(input SceneEdit, old *SceneEdit)

func (*Scene) CopyFromUpdateInput

func (p *Scene) CopyFromUpdateInput(input SceneUpdateInput) error

func (Scene) GetID

func (p Scene) GetID() uuid.UUID

func (*Scene) IsEditTarget

func (p *Scene) IsEditTarget()

func (Scene) ResolveDate added in v0.2.0

func (p Scene) ResolveDate() *FuzzyDate

func (*Scene) ValidateModifyEdit added in v0.1.0

func (p *Scene) ValidateModifyEdit(edit SceneEditData) error

type SceneCreateInput added in v0.1.0

type SceneCreateInput struct {
	Title        *string                     `json:"title,omitempty"`
	Details      *string                     `json:"details,omitempty"`
	Urls         []*URLInput                 `json:"urls,omitempty"`
	Date         string                      `json:"date"`
	StudioID     *uuid.UUID                  `json:"studio_id,omitempty"`
	Performers   []*PerformerAppearanceInput `json:"performers,omitempty"`
	TagIds       []uuid.UUID                 `json:"tag_ids,omitempty"`
	ImageIds     []uuid.UUID                 `json:"image_ids,omitempty"`
	Fingerprints []*FingerprintEditInput     `json:"fingerprints"`
	Duration     *int                        `json:"duration,omitempty"`
	Director     *string                     `json:"director,omitempty"`
	Code         *string                     `json:"code,omitempty"`
}

type SceneDestroyInput added in v0.1.0

type SceneDestroyInput struct {
	ID uuid.UUID `json:"id"`
}

type SceneDraft added in v0.1.0

type SceneDraft struct {
	ID           *uuid.UUID         `json:"id,omitempty"`
	Title        *string            `json:"title,omitempty"`
	Code         *string            `json:"code,omitempty"`
	Details      *string            `json:"details,omitempty"`
	Director     *string            `json:"director,omitempty"`
	URL          *string            `json:"url,omitempty"`
	Date         *string            `json:"date,omitempty"`
	Studio       *DraftEntity       `json:"studio,omitempty"`
	Performers   []DraftEntity      `json:"performers,omitempty"`
	Tags         []DraftEntity      `json:"tags,omitempty"`
	Image        *uuid.UUID         `json:"image,omitempty"`
	Fingerprints []DraftFingerprint `json:"fingerprints"`
}

func (SceneDraft) IsDraftData added in v0.1.0

func (SceneDraft) IsDraftData()

type SceneDraftInput added in v0.1.0

type SceneDraftInput struct {
	ID           *uuid.UUID          `json:"id,omitempty"`
	Title        *string             `json:"title,omitempty"`
	Code         *string             `json:"code,omitempty"`
	Details      *string             `json:"details,omitempty"`
	Director     *string             `json:"director,omitempty"`
	URL          *string             `json:"url,omitempty"`
	Date         *string             `json:"date,omitempty"`
	Studio       *DraftEntityInput   `json:"studio,omitempty"`
	Performers   []*DraftEntityInput `json:"performers"`
	Tags         []*DraftEntityInput `json:"tags,omitempty"`
	Image        *graphql.Upload     `json:"image,omitempty"`
	Fingerprints []*FingerprintInput `json:"fingerprints"`
}

type SceneDraftPerformer added in v0.1.0

type SceneDraftPerformer interface {
	IsSceneDraftPerformer()
}

type SceneDraftResolver added in v0.1.0

type SceneDraftResolver interface {
	URL(ctx context.Context, obj *SceneDraft) (*URL, error)

	Studio(ctx context.Context, obj *SceneDraft) (SceneDraftStudio, error)
	Performers(ctx context.Context, obj *SceneDraft) ([]SceneDraftPerformer, error)
	Tags(ctx context.Context, obj *SceneDraft) ([]SceneDraftTag, error)
	Image(ctx context.Context, obj *SceneDraft) (*Image, error)
}

type SceneDraftStudio added in v0.1.0

type SceneDraftStudio interface {
	IsSceneDraftStudio()
}

type SceneDraftTag added in v0.1.0

type SceneDraftTag interface {
	IsSceneDraftTag()
}

type SceneEdit added in v0.1.0

type SceneEdit struct {
	EditID              uuid.UUID                   `json:"-"`
	Title               *string                     `json:"title,omitempty"`
	Details             *string                     `json:"details,omitempty"`
	AddedUrls           []*URL                      `json:"added_urls,omitempty"`
	RemovedUrls         []*URL                      `json:"removed_urls,omitempty"`
	Date                *string                     `json:"date,omitempty"`
	DateAccuracy        *string                     `json:"date_accuracy,omitempty"`
	StudioID            *uuid.UUID                  `json:"studio_id,omitempty"`
	AddedPerformers     []*PerformerAppearanceInput `json:"added_performers,omitempty"`
	RemovedPerformers   []*PerformerAppearanceInput `json:"removed_performers,omitempty"`
	AddedTags           []uuid.UUID                 `json:"added_tags,omitempty"`
	RemovedTags         []uuid.UUID                 `json:"removed_tags,omitempty"`
	AddedImages         []uuid.UUID                 `json:"added_images,omitempty"`
	RemovedImages       []uuid.UUID                 `json:"removed_images,omitempty"`
	AddedFingerprints   []*FingerprintInput         `json:"added_fingerprints,omitempty"`
	RemovedFingerprints []*FingerprintInput         `json:"removed_fingerprints,omitempty"`
	Duration            *int64                      `json:"duration,omitempty"`
	Director            *string                     `json:"director,omitempty"`
	Code                *string                     `json:"code,omitempty"`
	DraftID             *uuid.UUID                  `json:"draft_id,omitempty"`
}

func (SceneEdit) IsEditDetails added in v0.1.0

func (SceneEdit) IsEditDetails()

type SceneEditData added in v0.1.0

type SceneEditData struct {
	New          *SceneEdit  `json:"new_data,omitempty"`
	Old          *SceneEdit  `json:"old_data,omitempty"`
	MergeSources []uuid.UUID `json:"merge_sources,omitempty"`
}

type SceneEditDetailsInput added in v0.1.0

type SceneEditDetailsInput struct {
	Title        *string                     `json:"title,omitempty"`
	Details      *string                     `json:"details,omitempty"`
	Urls         []*URLInput                 `json:"urls,omitempty"`
	Date         *string                     `json:"date,omitempty"`
	StudioID     *uuid.UUID                  `json:"studio_id,omitempty"`
	Performers   []*PerformerAppearanceInput `json:"performers,omitempty"`
	TagIds       []uuid.UUID                 `json:"tag_ids,omitempty"`
	ImageIds     []uuid.UUID                 `json:"image_ids,omitempty"`
	Duration     *int                        `json:"duration,omitempty"`
	Director     *string                     `json:"director,omitempty"`
	Code         *string                     `json:"code,omitempty"`
	Fingerprints []*FingerprintInput         `json:"fingerprints,omitempty"`
	DraftID      *uuid.UUID                  `json:"draft_id,omitempty"`
}

func (SceneEditDetailsInput) SceneEditFromCreate added in v0.1.0

func (e SceneEditDetailsInput) SceneEditFromCreate(inputArgs utils.ArgumentsQuery) (*SceneEditData, error)

func (SceneEditDetailsInput) SceneEditFromDiff added in v0.1.0

func (e SceneEditDetailsInput) SceneEditFromDiff(orig Scene, inputArgs utils.ArgumentsQuery) (*SceneEditData, error)

func (SceneEditDetailsInput) SceneEditFromMerge added in v0.1.0

func (e SceneEditDetailsInput) SceneEditFromMerge(orig Scene, sources []uuid.UUID, inputArgs utils.ArgumentsQuery) (*SceneEditData, error)

type SceneEditInput added in v0.1.0

type SceneEditInput struct {
	Edit *EditInput `json:"edit"`
	// Not required for destroy type
	Details *SceneEditDetailsInput `json:"details,omitempty"`
}

type SceneEditResolver added in v0.1.0

type SceneEditResolver interface {
	Date(ctx context.Context, obj *SceneEdit) (*string, error)
	Studio(ctx context.Context, obj *SceneEdit) (*Studio, error)
	AddedPerformers(ctx context.Context, obj *SceneEdit) ([]*PerformerAppearance, error)
	RemovedPerformers(ctx context.Context, obj *SceneEdit) ([]*PerformerAppearance, error)
	AddedTags(ctx context.Context, obj *SceneEdit) ([]*Tag, error)
	RemovedTags(ctx context.Context, obj *SceneEdit) ([]*Tag, error)
	AddedImages(ctx context.Context, obj *SceneEdit) ([]*Image, error)
	RemovedImages(ctx context.Context, obj *SceneEdit) ([]*Image, error)
	AddedFingerprints(ctx context.Context, obj *SceneEdit) ([]*Fingerprint, error)
	RemovedFingerprints(ctx context.Context, obj *SceneEdit) ([]*Fingerprint, error)

	Urls(ctx context.Context, obj *SceneEdit) ([]*URL, error)
	Performers(ctx context.Context, obj *SceneEdit) ([]*PerformerAppearance, error)
	Tags(ctx context.Context, obj *SceneEdit) ([]*Tag, error)
	Images(ctx context.Context, obj *SceneEdit) ([]*Image, error)
	Fingerprints(ctx context.Context, obj *SceneEdit) ([]*Fingerprint, error)
}

type SceneFingerprint

type SceneFingerprint struct {
	SceneID   uuid.UUID `db:"scene_id" json:"scene_id"`
	UserID    uuid.UUID `db:"user_id" json:"user_id"`
	Hash      string    `db:"hash" json:"hash"`
	Algorithm string    `db:"algorithm" json:"algorithm"`
	Duration  int       `db:"duration" json:"duration"`
	CreatedAt time.Time `db:"created_at" json:"created_at"`
}

type SceneFingerprints

type SceneFingerprints []*SceneFingerprint

func CreateSceneFingerprints

func CreateSceneFingerprints(sceneID uuid.UUID, fingerprints []*FingerprintEditInput) SceneFingerprints

func CreateSubmittedSceneFingerprints

func CreateSubmittedSceneFingerprints(sceneID uuid.UUID, fingerprints []*FingerprintInput) SceneFingerprints

func (*SceneFingerprints) Add

func (f *SceneFingerprints) Add(o interface{})

func (SceneFingerprints) Each

func (f SceneFingerprints) Each(fn func(interface{}))

func (SceneFingerprints) EachPtr added in v0.1.0

func (f SceneFingerprints) EachPtr(fn func(interface{}))

type SceneImage

type SceneImage struct {
	SceneID uuid.UUID `db:"scene_id" json:"scene_id"`
	ImageID uuid.UUID `db:"image_id" json:"image_id"`
}

func (SceneImage) ID added in v0.1.0

func (p SceneImage) ID() string

type SceneQuery added in v0.1.0

type SceneQuery struct {
	Filter SceneQueryInput
}

type SceneQueryInput added in v0.1.6

type SceneQueryInput struct {
	// Filter to search title and details - assumes like query unless quoted
	Text *string `json:"text,omitempty"`
	// Filter to search title - assumes like query unless quoted
	Title *string `json:"title,omitempty"`
	// Filter to search urls - assumes like query unless quoted
	URL *string `json:"url,omitempty"`
	// Filter by date
	Date *DateCriterionInput `json:"date,omitempty"`
	// Filter to only include scenes with this studio
	Studios *MultiIDCriterionInput `json:"studios,omitempty"`
	// Filter to only include scenes with this studio as primary or parent
	ParentStudio *string `json:"parentStudio,omitempty"`
	// Filter to only include scenes with these tags
	Tags *MultiIDCriterionInput `json:"tags,omitempty"`
	// Filter to only include scenes with these performers
	Performers *MultiIDCriterionInput `json:"performers,omitempty"`
	// Filter to include scenes with performer appearing as alias
	Alias *StringCriterionInput `json:"alias,omitempty"`
	// Filter to only include scenes with these fingerprints
	Fingerprints *MultiStringCriterionInput `json:"fingerprints,omitempty"`
	// Filter by favorited entity
	Favorites *FavoriteFilter `json:"favorites,omitempty"`
	// Filter to scenes with fingerprints submitted by the user
	HasFingerprintSubmissions *bool             `json:"has_fingerprint_submissions,omitempty"`
	Page                      int               `json:"page"`
	PerPage                   int               `json:"per_page"`
	Direction                 SortDirectionEnum `json:"direction"`
	Sort                      SceneSortEnum     `json:"sort"`
}

type SceneRepo

type SceneRepo interface {
	Create(newScene Scene) (*Scene, error)
	Update(updatedScene Scene) (*Scene, error)
	Destroy(id uuid.UUID) error
	SoftDelete(scene Scene) (*Scene, error)
	CreateURLs(newJoins SceneURLs) error
	UpdateURLs(scene uuid.UUID, updatedJoins SceneURLs) error
	CreateFingerprints(newJoins SceneFingerprints) error
	UpdateFingerprints(sceneID uuid.UUID, updatedJoins SceneFingerprints) error
	DestroyFingerprints(sceneID uuid.UUID, toDelete SceneFingerprints) error
	Find(id uuid.UUID) (*Scene, error)
	FindByIds(ids []uuid.UUID) ([]*Scene, error)
	FindByFingerprint(algorithm FingerprintAlgorithm, hash string) ([]*Scene, error)
	FindByFingerprints(fingerprints []string) ([]*Scene, error)
	FindByFullFingerprints(fingerprints []*FingerprintQueryInput) ([]*Scene, error)
	FindIdsBySceneFingerprints(fingerprints []*FingerprintQueryInput) (map[string][]uuid.UUID, error)
	FindExistingScenes(input QueryExistingSceneInput) ([]*Scene, error)
	Count() (int, error)
	QueryScenes(filter SceneQueryInput, userID uuid.UUID) ([]*Scene, error)
	QueryCount(filter SceneQueryInput, userID uuid.UUID) (int, error)
	GetFingerprints(id uuid.UUID) (SceneFingerprints, error)

	// GetAllFingerprints returns fingerprints for each of the scene ids provided.
	// currentUserID is used to populate the UserSubmitted field.
	GetAllFingerprints(currentUserID uuid.UUID, ids []uuid.UUID, onlySubmitted bool) ([][]*Fingerprint, []error)
	GetPerformers(id uuid.UUID) (PerformersScenes, error)
	GetAllAppearances(ids []uuid.UUID) ([]PerformersScenes, []error)
	GetURLs(id uuid.UUID) ([]*URL, error)
	GetAllURLs(ids []uuid.UUID) ([][]*URL, []error)
	SearchScenes(term string, limit int) ([]*Scene, error)
	CountByPerformer(id uuid.UUID) (int, error)
	MergeInto(source *Scene, target *Scene) error
	ApplyEdit(scene *Scene, create bool, data *SceneEditData, userID *uuid.UUID) (*Scene, error)
	GetEditTags(id *uuid.UUID, data *SceneEdit) ([]uuid.UUID, error)
	GetEditImages(id *uuid.UUID, data *SceneEdit) ([]uuid.UUID, error)
	GetEditURLs(id *uuid.UUID, data *SceneEdit) ([]*URL, error)
	GetEditPerformers(id *uuid.UUID, obj *SceneEdit) ([]*PerformerAppearanceInput, error)
}

type SceneResolver added in v0.1.0

type SceneResolver interface {
	Title(ctx context.Context, obj *Scene) (*string, error)
	Details(ctx context.Context, obj *Scene) (*string, error)
	Date(ctx context.Context, obj *Scene) (*string, error)
	ReleaseDate(ctx context.Context, obj *Scene) (*string, error)
	Urls(ctx context.Context, obj *Scene) ([]*URL, error)
	Studio(ctx context.Context, obj *Scene) (*Studio, error)
	Tags(ctx context.Context, obj *Scene) ([]*Tag, error)
	Images(ctx context.Context, obj *Scene) ([]*Image, error)
	Performers(ctx context.Context, obj *Scene) ([]*PerformerAppearance, error)
	Fingerprints(ctx context.Context, obj *Scene, isSubmitted *bool) ([]*Fingerprint, error)
	Duration(ctx context.Context, obj *Scene) (*int, error)
	Director(ctx context.Context, obj *Scene) (*string, error)
	Code(ctx context.Context, obj *Scene) (*string, error)

	Edits(ctx context.Context, obj *Scene) ([]*Edit, error)
	Created(ctx context.Context, obj *Scene) (*time.Time, error)
	Updated(ctx context.Context, obj *Scene) (*time.Time, error)
}

type SceneSortEnum added in v0.1.6

type SceneSortEnum string
const (
	SceneSortEnumTitle     SceneSortEnum = "TITLE"
	SceneSortEnumDate      SceneSortEnum = "DATE"
	SceneSortEnumTrending  SceneSortEnum = "TRENDING"
	SceneSortEnumCreatedAt SceneSortEnum = "CREATED_AT"
	SceneSortEnumUpdatedAt SceneSortEnum = "UPDATED_AT"
)

func (SceneSortEnum) IsValid added in v0.1.6

func (e SceneSortEnum) IsValid() bool

func (SceneSortEnum) MarshalGQL added in v0.1.6

func (e SceneSortEnum) MarshalGQL(w io.Writer)

func (SceneSortEnum) String added in v0.1.6

func (e SceneSortEnum) String() string

func (*SceneSortEnum) UnmarshalGQL added in v0.1.6

func (e *SceneSortEnum) UnmarshalGQL(v interface{}) error

type SceneTag

type SceneTag struct {
	SceneID uuid.UUID `db:"scene_id" json:"scene_id"`
	TagID   uuid.UUID `db:"tag_id" json:"tag_id"`
}

func (SceneTag) ID added in v0.1.0

func (p SceneTag) ID() string

type SceneURL

type SceneURL struct {
	SceneID uuid.UUID `db:"scene_id" json:"scene_id"`
	SiteID  uuid.UUID `db:"site_id" json:"site_id"`
	URL     string    `db:"url" json:"url"`
}

func (SceneURL) ID added in v0.1.0

func (u SceneURL) ID() string

func (*SceneURL) ToURL

func (u *SceneURL) ToURL() URL

type SceneURLs

type SceneURLs []*SceneURL

func CreateSceneURLs

func CreateSceneURLs(sceneID uuid.UUID, urls []*URL) SceneURLs

func (*SceneURLs) Add

func (u *SceneURLs) Add(o interface{})

func (SceneURLs) Each

func (u SceneURLs) Each(fn func(interface{}))

func (SceneURLs) EachPtr added in v0.1.0

func (u SceneURLs) EachPtr(fn func(interface{}))

func (*SceneURLs) Remove added in v0.1.0

func (u *SceneURLs) Remove(id string)

type SceneUpdateInput added in v0.1.0

type SceneUpdateInput struct {
	ID           uuid.UUID                   `json:"id"`
	Title        *string                     `json:"title,omitempty"`
	Details      *string                     `json:"details,omitempty"`
	Urls         []*URLInput                 `json:"urls,omitempty"`
	Date         *string                     `json:"date,omitempty"`
	StudioID     *uuid.UUID                  `json:"studio_id,omitempty"`
	Performers   []*PerformerAppearanceInput `json:"performers,omitempty"`
	TagIds       []uuid.UUID                 `json:"tag_ids,omitempty"`
	ImageIds     []uuid.UUID                 `json:"image_ids,omitempty"`
	Fingerprints []*FingerprintEditInput     `json:"fingerprints,omitempty"`
	Duration     *int                        `json:"duration,omitempty"`
	Director     *string                     `json:"director,omitempty"`
	Code         *string                     `json:"code,omitempty"`
}

type Scenes

type Scenes []*Scene

func (*Scenes) Add

func (p *Scenes) Add(o interface{})

func (Scenes) Each

func (p Scenes) Each(fn func(interface{}))

type ScenesImages

type ScenesImages []*SceneImage

func CreateSceneImages

func CreateSceneImages(sceneID uuid.UUID, imageIds []uuid.UUID) ScenesImages

func (*ScenesImages) Add

func (p *ScenesImages) Add(o interface{})

func (ScenesImages) Each

func (p ScenesImages) Each(fn func(interface{}))

func (ScenesImages) EachPtr added in v0.1.0

func (p ScenesImages) EachPtr(fn func(interface{}))

func (*ScenesImages) Remove added in v0.1.0

func (p *ScenesImages) Remove(id string)

type ScenesTags

type ScenesTags []*SceneTag

func CreateSceneTags

func CreateSceneTags(sceneID uuid.UUID, tagIds []uuid.UUID) ScenesTags

func (*ScenesTags) Add

func (p *ScenesTags) Add(o interface{})

func (ScenesTags) Each

func (p ScenesTags) Each(fn func(interface{}))

func (ScenesTags) EachPtr added in v0.1.0

func (p ScenesTags) EachPtr(fn func(interface{}))

func (*ScenesTags) Remove added in v0.1.0

func (p *ScenesTags) Remove(id string)

type Site added in v0.1.0

type Site struct {
	ID          uuid.UUID      `db:"id" json:"id"`
	Name        string         `db:"name" json:"name"`
	Description sql.NullString `db:"description" json:"description"`
	URL         sql.NullString `db:"url" json:"url"`
	Regex       sql.NullString `db:"regex" json:"regex"`
	ValidTypes  pq.StringArray `db:"valid_types" json:"valid_types"`
	CreatedAt   time.Time      `db:"created_at" json:"created_at"`
	UpdatedAt   time.Time      `db:"updated_at" json:"updated_at"`
}

func (*Site) CopyFromCreateInput added in v0.1.0

func (s *Site) CopyFromCreateInput(input SiteCreateInput)

func (*Site) CopyFromUpdateInput added in v0.1.0

func (s *Site) CopyFromUpdateInput(input SiteUpdateInput)

func (Site) GetID added in v0.1.0

func (s Site) GetID() uuid.UUID

type SiteCreateInput added in v0.1.0

type SiteCreateInput struct {
	Name        string              `json:"name"`
	Description *string             `json:"description,omitempty"`
	URL         *string             `json:"url,omitempty"`
	Regex       *string             `json:"regex,omitempty"`
	ValidTypes  []ValidSiteTypeEnum `json:"valid_types"`
}

type SiteDestroyInput added in v0.1.0

type SiteDestroyInput struct {
	ID uuid.UUID `json:"id"`
}

type SiteRepo added in v0.1.0

type SiteRepo interface {
	Create(newSite Site) (*Site, error)
	Update(updatedSite Site) (*Site, error)
	Destroy(id uuid.UUID) error
	Find(id uuid.UUID) (*Site, error)
	FindByIds(ids []uuid.UUID) ([]*Site, []error)
	Query() ([]*Site, int, error)
}

type SiteResolver added in v0.1.0

type SiteResolver interface {
	Description(ctx context.Context, obj *Site) (*string, error)
	URL(ctx context.Context, obj *Site) (*string, error)
	Regex(ctx context.Context, obj *Site) (*string, error)
	ValidTypes(ctx context.Context, obj *Site) ([]ValidSiteTypeEnum, error)
	Icon(ctx context.Context, obj *Site) (string, error)
	Created(ctx context.Context, obj *Site) (*time.Time, error)
	Updated(ctx context.Context, obj *Site) (*time.Time, error)
}

type SiteUpdateInput added in v0.1.0

type SiteUpdateInput struct {
	ID          uuid.UUID           `json:"id"`
	Name        string              `json:"name"`
	Description *string             `json:"description,omitempty"`
	URL         *string             `json:"url,omitempty"`
	Regex       *string             `json:"regex,omitempty"`
	ValidTypes  []ValidSiteTypeEnum `json:"valid_types"`
}

type Sites added in v0.1.0

type Sites []*Site

func (*Sites) Add added in v0.1.0

func (s *Sites) Add(o interface{})

func (Sites) Each added in v0.1.0

func (s Sites) Each(fn func(interface{}))

type SortDirectionEnum added in v0.1.0

type SortDirectionEnum string
const (
	SortDirectionEnumAsc  SortDirectionEnum = "ASC"
	SortDirectionEnumDesc SortDirectionEnum = "DESC"
)

func (SortDirectionEnum) IsValid added in v0.1.0

func (e SortDirectionEnum) IsValid() bool

func (SortDirectionEnum) MarshalGQL added in v0.1.0

func (e SortDirectionEnum) MarshalGQL(w io.Writer)

func (SortDirectionEnum) String added in v0.1.0

func (e SortDirectionEnum) String() string

func (*SortDirectionEnum) UnmarshalGQL added in v0.1.0

func (e *SortDirectionEnum) UnmarshalGQL(v interface{}) error

type StashBoxConfig added in v0.1.0

type StashBoxConfig struct {
	HostURL                    string `json:"host_url"`
	RequireInvite              bool   `json:"require_invite"`
	RequireActivation          bool   `json:"require_activation"`
	VotePromotionThreshold     *int   `json:"vote_promotion_threshold,omitempty"`
	VoteApplicationThreshold   int    `json:"vote_application_threshold"`
	VotingPeriod               int    `json:"voting_period"`
	MinDestructiveVotingPeriod int    `json:"min_destructive_voting_period"`
	VoteCronInterval           string `json:"vote_cron_interval"`
	GuidelinesURL              string `json:"guidelines_url"`
}

type StringCriterionInput added in v0.1.0

type StringCriterionInput struct {
	Value    string            `json:"value"`
	Modifier CriterionModifier `json:"modifier"`
}

type Studio

type Studio struct {
	ID             uuid.UUID     `db:"id" json:"id"`
	Name           string        `db:"name" json:"name"`
	ParentStudioID uuid.NullUUID `db:"parent_studio_id,omitempty" json:"parent_studio_id"`
	CreatedAt      time.Time     `db:"created_at" json:"created_at"`
	UpdatedAt      time.Time     `db:"updated_at" json:"updated_at"`
	Deleted        bool          `db:"deleted" json:"deleted"`
}

func (*Studio) CopyFromCreateInput

func (s *Studio) CopyFromCreateInput(input StudioCreateInput)

func (*Studio) CopyFromStudioEdit added in v0.1.0

func (s *Studio) CopyFromStudioEdit(input StudioEdit, existing *StudioEdit)

func (*Studio) CopyFromUpdateInput

func (s *Studio) CopyFromUpdateInput(input StudioUpdateInput)

func (Studio) GetID

func (s Studio) GetID() uuid.UUID

func (*Studio) IsEditTarget

func (s *Studio) IsEditTarget()

func (Studio) IsSceneDraftStudio added in v0.1.0

func (Studio) IsSceneDraftStudio()

func (*Studio) ValidateModifyEdit added in v0.1.0

func (s *Studio) ValidateModifyEdit(edit StudioEditData) error

type StudioCreateInput added in v0.1.0

type StudioCreateInput struct {
	Name     string      `json:"name"`
	Urls     []*URLInput `json:"urls,omitempty"`
	ParentID *uuid.UUID  `json:"parent_id,omitempty"`
	ImageIds []uuid.UUID `json:"image_ids,omitempty"`
}

type StudioDestroyInput added in v0.1.0

type StudioDestroyInput struct {
	ID uuid.UUID `json:"id"`
}

type StudioEdit added in v0.1.0

type StudioEdit struct {
	EditID uuid.UUID `json:"-"`
	Name   *string   `json:"name"`
	// Added and modified URLs
	AddedUrls     []*URL      `json:"added_urls,omitempty"`
	RemovedUrls   []*URL      `json:"removed_urls,omitempty"`
	ParentID      *uuid.UUID  `json:"parent_id,omitempty"`
	AddedImages   []uuid.UUID `json:"added_images,omitempty"`
	RemovedImages []uuid.UUID `json:"removed_images,omitempty"`
}

func (StudioEdit) IsEditDetails added in v0.1.0

func (StudioEdit) IsEditDetails()

type StudioEditData added in v0.1.0

type StudioEditData struct {
	New          *StudioEdit `json:"new_data,omitempty"`
	Old          *StudioEdit `json:"old_data,omitempty"`
	MergeSources []uuid.UUID `json:"merge_sources,omitempty"`
}

type StudioEditDetailsInput added in v0.1.0

type StudioEditDetailsInput struct {
	Name     *string     `json:"name,omitempty"`
	Urls     []*URLInput `json:"urls,omitempty"`
	ParentID *uuid.UUID  `json:"parent_id,omitempty"`
	ImageIds []uuid.UUID `json:"image_ids,omitempty"`
}

func (StudioEditDetailsInput) StudioEditFromCreate added in v0.1.0

func (e StudioEditDetailsInput) StudioEditFromCreate() StudioEditData

func (StudioEditDetailsInput) StudioEditFromDiff added in v0.1.0

func (e StudioEditDetailsInput) StudioEditFromDiff(orig Studio, inputArgs utils.ArgumentsQuery) (*StudioEditData, error)

func (StudioEditDetailsInput) StudioEditFromMerge added in v0.1.0

func (e StudioEditDetailsInput) StudioEditFromMerge(orig Studio, sources []uuid.UUID, inputArgs utils.ArgumentsQuery) (*StudioEditData, error)

type StudioEditInput added in v0.1.0

type StudioEditInput struct {
	Edit *EditInput `json:"edit"`
	// Not required for destroy type
	Details *StudioEditDetailsInput `json:"details,omitempty"`
}

type StudioEditResolver added in v0.1.0

type StudioEditResolver interface {
	Parent(ctx context.Context, obj *StudioEdit) (*Studio, error)
	AddedImages(ctx context.Context, obj *StudioEdit) ([]*Image, error)
	RemovedImages(ctx context.Context, obj *StudioEdit) ([]*Image, error)
	Images(ctx context.Context, obj *StudioEdit) ([]*Image, error)
	Urls(ctx context.Context, obj *StudioEdit) ([]*URL, error)
}

type StudioFavorite added in v0.1.0

type StudioFavorite struct {
	StudioID uuid.UUID `db:"studio_id" json:"studio_id"`
	UserID   uuid.UUID `db:"user_id" json:"user_id"`
}

type StudioImage

type StudioImage struct {
	StudioID uuid.UUID `db:"studio_id" json:"studio_id"`
	ImageID  uuid.UUID `db:"image_id" json:"image_id"`
}

func (StudioImage) ID added in v0.1.0

func (s StudioImage) ID() string

type StudioQueryInput added in v0.1.6

type StudioQueryInput struct {
	// Filter to search name - assumes like query unless quoted
	Name *string `json:"name,omitempty"`
	// Filter to search studio and parent studio name - assumes like query unless quoted
	Names *string `json:"names,omitempty"`
	// Filter to search url - assumes like query unless quoted
	URL       *string           `json:"url,omitempty"`
	Parent    *IDCriterionInput `json:"parent,omitempty"`
	HasParent *bool             `json:"has_parent,omitempty"`
	// Filter by studio favorite status for the current user
	IsFavorite *bool             `json:"is_favorite,omitempty"`
	Page       int               `json:"page"`
	PerPage    int               `json:"per_page"`
	Direction  SortDirectionEnum `json:"direction"`
	Sort       StudioSortEnum    `json:"sort"`
}

type StudioRepo

type StudioRepo interface {
	Create(newStudio Studio) (*Studio, error)
	Update(updatedStudio Studio) (*Studio, error)
	Destroy(id uuid.UUID) error
	CreateURLs(newJoins StudioURLs) error
	UpdateURLs(studioID uuid.UUID, updatedJoins StudioURLs) error
	Find(id uuid.UUID) (*Studio, error)
	FindWithRedirect(id uuid.UUID) (*Studio, error)
	FindByIds(ids []uuid.UUID) ([]*Studio, []error)
	FindByName(name string) (*Studio, error)
	FindByParentID(id uuid.UUID) (Studios, error)
	Count() (int, error)
	Query(query StudioQueryInput, userID uuid.UUID) (Studios, int, error)
	GetURLs(id uuid.UUID) ([]*URL, error)
	GetAllURLs(ids []uuid.UUID) ([][]*URL, []error)
	CountByPerformer(performerID uuid.UUID) ([]*PerformerStudio, error)
	ApplyEdit(edit Edit, operation OperationEnum, studio *Studio) (*Studio, error)
	GetEditImages(id *uuid.UUID, data *StudioEdit) ([]uuid.UUID, error)
	GetEditURLs(id *uuid.UUID, data *StudioEdit) ([]*URL, error)
	IsFavoriteByIds(userID uuid.UUID, ids []uuid.UUID) ([]bool, []error)
}

type StudioResolver added in v0.1.0

type StudioResolver interface {
	Urls(ctx context.Context, obj *Studio) ([]*URL, error)
	Parent(ctx context.Context, obj *Studio) (*Studio, error)
	ChildStudios(ctx context.Context, obj *Studio) ([]*Studio, error)
	Images(ctx context.Context, obj *Studio) ([]*Image, error)

	IsFavorite(ctx context.Context, obj *Studio) (bool, error)
	Created(ctx context.Context, obj *Studio) (*time.Time, error)
	Updated(ctx context.Context, obj *Studio) (*time.Time, error)
	Performers(ctx context.Context, obj *Studio, input PerformerQueryInput) (*PerformerQuery, error)
}

type StudioSortEnum added in v0.1.6

type StudioSortEnum string
const (
	StudioSortEnumName      StudioSortEnum = "NAME"
	StudioSortEnumCreatedAt StudioSortEnum = "CREATED_AT"
	StudioSortEnumUpdatedAt StudioSortEnum = "UPDATED_AT"
)

func (StudioSortEnum) IsValid added in v0.1.6

func (e StudioSortEnum) IsValid() bool

func (StudioSortEnum) MarshalGQL added in v0.1.6

func (e StudioSortEnum) MarshalGQL(w io.Writer)

func (StudioSortEnum) String added in v0.1.6

func (e StudioSortEnum) String() string

func (*StudioSortEnum) UnmarshalGQL added in v0.1.6

func (e *StudioSortEnum) UnmarshalGQL(v interface{}) error

type StudioURL

type StudioURL struct {
	StudioID uuid.UUID `db:"studio_id" json:"studio_id"`
	SiteID   uuid.UUID `db:"site_id" json:"site_id"`
	URL      string    `db:"url" json:"url"`
}

func (StudioURL) ID added in v0.1.0

func (s StudioURL) ID() string

func (*StudioURL) ToURL

func (s *StudioURL) ToURL() URL

type StudioURLs

type StudioURLs []*StudioURL

func CreateStudioURLs

func CreateStudioURLs(studioID uuid.UUID, urls []*URL) StudioURLs

func (*StudioURLs) Add

func (s *StudioURLs) Add(o interface{})

func (StudioURLs) Each

func (s StudioURLs) Each(fn func(interface{}))

func (StudioURLs) EachPtr added in v0.1.0

func (s StudioURLs) EachPtr(fn func(interface{}))

func (*StudioURLs) Remove added in v0.1.0

func (s *StudioURLs) Remove(id string)

type StudioUpdateInput added in v0.1.0

type StudioUpdateInput struct {
	ID       uuid.UUID   `json:"id"`
	Name     *string     `json:"name,omitempty"`
	Urls     []*URLInput `json:"urls,omitempty"`
	ParentID *uuid.UUID  `json:"parent_id,omitempty"`
	ImageIds []uuid.UUID `json:"image_ids,omitempty"`
}

type Studios

type Studios []*Studio

func (*Studios) Add

func (s *Studios) Add(o interface{})

func (Studios) Each

func (s Studios) Each(fn func(interface{}))

type StudiosImages

type StudiosImages []*StudioImage

func CreateStudioImages

func CreateStudioImages(studioID uuid.UUID, imageIds []uuid.UUID) StudiosImages

func (*StudiosImages) Add

func (p *StudiosImages) Add(o interface{})

func (StudiosImages) Each

func (p StudiosImages) Each(fn func(interface{}))

func (StudiosImages) EachPtr added in v0.1.0

func (p StudiosImages) EachPtr(fn func(interface{}))

func (*StudiosImages) Remove added in v0.1.0

func (p *StudiosImages) Remove(id string)

type Tag

type Tag struct {
	ID          uuid.UUID      `db:"id" json:"id"`
	Name        string         `db:"name" json:"name"`
	CategoryID  uuid.NullUUID  `db:"category_id" json:"category_id"`
	Description sql.NullString `db:"description" json:"description"`
	CreatedAt   time.Time      `db:"created_at" json:"created_at"`
	UpdatedAt   time.Time      `db:"updated_at" json:"updated_at"`
	Deleted     bool           `db:"deleted" json:"deleted"`
}

func (*Tag) CopyFromCreateInput

func (p *Tag) CopyFromCreateInput(input TagCreateInput)

func (*Tag) CopyFromTagEdit

func (p *Tag) CopyFromTagEdit(input TagEdit, existing *TagEdit)

func (*Tag) CopyFromUpdateInput

func (p *Tag) CopyFromUpdateInput(input TagUpdateInput)

func (Tag) GetID

func (p Tag) GetID() uuid.UUID

func (*Tag) IsEditTarget

func (p *Tag) IsEditTarget()

func (Tag) IsSceneDraftTag added in v0.1.0

func (Tag) IsSceneDraftTag()

func (*Tag) ValidateModifyEdit

func (p *Tag) ValidateModifyEdit(edit TagEditData) error

type TagAlias

type TagAlias struct {
	TagID uuid.UUID `db:"tag_id" json:"tag_id"`
	Alias string    `db:"alias" json:"alias"`
}

func CreateTagAliases

func CreateTagAliases(tagID uuid.UUID, aliases []string) []*TagAlias

type TagAliases

type TagAliases []*TagAlias

func (*TagAliases) Add

func (p *TagAliases) Add(o interface{})

func (*TagAliases) AddAliases

func (p *TagAliases) AddAliases(newAliases []*TagAlias) error

func (TagAliases) Each

func (p TagAliases) Each(fn func(interface{}))

func (*TagAliases) Remove

func (p *TagAliases) Remove(alias string)

func (*TagAliases) RemoveAliases

func (p *TagAliases) RemoveAliases(oldAliases []string) error

func (TagAliases) ToAliases

func (p TagAliases) ToAliases() []string

type TagCategories

type TagCategories []*TagCategory

func (*TagCategories) Add

func (p *TagCategories) Add(o interface{})

func (TagCategories) Each

func (p TagCategories) Each(fn func(interface{}))

type TagCategory

type TagCategory struct {
	ID          uuid.UUID      `db:"id" json:"id"`
	Name        string         `db:"name" json:"name"`
	Group       string         `db:"group" json:"group"`
	Description sql.NullString `db:"description" json:"description"`
	CreatedAt   time.Time      `db:"created_at" json:"created_at"`
	UpdatedAt   time.Time      `db:"updated_at" json:"updated_at"`
}

func (*TagCategory) CopyFromCreateInput

func (p *TagCategory) CopyFromCreateInput(input TagCategoryCreateInput)

func (*TagCategory) CopyFromUpdateInput

func (p *TagCategory) CopyFromUpdateInput(input TagCategoryUpdateInput)

func (TagCategory) GetID

func (p TagCategory) GetID() uuid.UUID

type TagCategoryCreateInput added in v0.1.0

type TagCategoryCreateInput struct {
	Name        string       `json:"name"`
	Group       TagGroupEnum `json:"group"`
	Description *string      `json:"description,omitempty"`
}

type TagCategoryDestroyInput added in v0.1.0

type TagCategoryDestroyInput struct {
	ID uuid.UUID `json:"id"`
}

type TagCategoryRepo

type TagCategoryRepo interface {
	Create(newCategory TagCategory) (*TagCategory, error)
	Update(updatedCategory TagCategory) (*TagCategory, error)
	Destroy(id uuid.UUID) error
	Find(id uuid.UUID) (*TagCategory, error)
	FindByIds(ids []uuid.UUID) ([]*TagCategory, []error)
	Query() ([]*TagCategory, int, error)
}

type TagCategoryResolver added in v0.1.0

type TagCategoryResolver interface {
	Group(ctx context.Context, obj *TagCategory) (TagGroupEnum, error)
	Description(ctx context.Context, obj *TagCategory) (*string, error)
}

type TagCategoryUpdateInput added in v0.1.0

type TagCategoryUpdateInput struct {
	ID          uuid.UUID     `json:"id"`
	Name        *string       `json:"name,omitempty"`
	Group       *TagGroupEnum `json:"group,omitempty"`
	Description *string       `json:"description,omitempty"`
}

type TagCreateInput added in v0.1.0

type TagCreateInput struct {
	Name        string     `json:"name"`
	Description *string    `json:"description,omitempty"`
	Aliases     []string   `json:"aliases,omitempty"`
	CategoryID  *uuid.UUID `json:"category_id,omitempty"`
}

type TagDestroyInput added in v0.1.0

type TagDestroyInput struct {
	ID uuid.UUID `json:"id"`
}

type TagEdit

type TagEdit struct {
	EditID         uuid.UUID  `json:"-"`
	Name           *string    `json:"name,omitempty"`
	Description    *string    `json:"description,omitempty"`
	AddedAliases   []string   `json:"added_aliases,omitempty"`
	RemovedAliases []string   `json:"removed_aliases,omitempty"`
	CategoryID     *uuid.UUID `json:"category_id,omitempty"`
}

func (TagEdit) IsEditDetails

func (TagEdit) IsEditDetails()

type TagEditData

type TagEditData struct {
	New          *TagEdit    `json:"new_data,omitempty"`
	Old          *TagEdit    `json:"old_data,omitempty"`
	MergeSources []uuid.UUID `json:"merge_sources,omitempty"`
}

type TagEditDetailsInput added in v0.1.0

type TagEditDetailsInput struct {
	Name        *string    `json:"name,omitempty"`
	Description *string    `json:"description,omitempty"`
	Aliases     []string   `json:"aliases,omitempty"`
	CategoryID  *uuid.UUID `json:"category_id,omitempty"`
}

func (TagEditDetailsInput) TagEditFromCreate added in v0.1.0

func (e TagEditDetailsInput) TagEditFromCreate(inputArgs utils.ArgumentsQuery) TagEditData

func (TagEditDetailsInput) TagEditFromDiff added in v0.1.0

func (e TagEditDetailsInput) TagEditFromDiff(orig Tag, inputArgs utils.ArgumentsQuery) TagEditData

func (TagEditDetailsInput) TagEditFromMerge added in v0.1.0

func (e TagEditDetailsInput) TagEditFromMerge(orig Tag, sources []uuid.UUID, inputArgs utils.ArgumentsQuery) TagEditData

type TagEditInput added in v0.1.0

type TagEditInput struct {
	Edit *EditInput `json:"edit"`
	// Not required for destroy type
	Details *TagEditDetailsInput `json:"details,omitempty"`
}

type TagEditResolver added in v0.1.0

type TagEditResolver interface {
	Category(ctx context.Context, obj *TagEdit) (*TagCategory, error)
	Aliases(ctx context.Context, obj *TagEdit) ([]string, error)
}

type TagGroupEnum added in v0.1.0

type TagGroupEnum string
const (
	TagGroupEnumPeople TagGroupEnum = "PEOPLE"
	TagGroupEnumScene  TagGroupEnum = "SCENE"
	TagGroupEnumAction TagGroupEnum = "ACTION"
)

func (TagGroupEnum) IsValid added in v0.1.0

func (e TagGroupEnum) IsValid() bool

func (TagGroupEnum) MarshalGQL added in v0.1.0

func (e TagGroupEnum) MarshalGQL(w io.Writer)

func (TagGroupEnum) String added in v0.1.0

func (e TagGroupEnum) String() string

func (*TagGroupEnum) UnmarshalGQL added in v0.1.0

func (e *TagGroupEnum) UnmarshalGQL(v interface{}) error

type TagQueryInput added in v0.1.6

type TagQueryInput struct {
	// Filter to search name, aliases and description - assumes like query unless quoted
	Text *string `json:"text,omitempty"`
	// Searches name and aliases - assumes like query unless quoted
	Names *string `json:"names,omitempty"`
	// Filter to search name - assumes like query unless quoted
	Name *string `json:"name,omitempty"`
	// Filter to category ID
	CategoryID *uuid.UUID        `json:"category_id,omitempty"`
	Page       int               `json:"page"`
	PerPage    int               `json:"per_page"`
	Direction  SortDirectionEnum `json:"direction"`
	Sort       TagSortEnum       `json:"sort"`
}

type TagRepo

type TagRepo interface {
	Create(newTag Tag) (*Tag, error)
	Update(updatedTag Tag) (*Tag, error)
	UpdatePartial(updatedTag Tag) (*Tag, error)
	Destroy(id uuid.UUID) error
	CreateAliases(newJoins TagAliases) error
	UpdateAliases(tagID uuid.UUID, updatedJoins TagAliases) error
	Find(id uuid.UUID) (*Tag, error)
	FindBySceneID(sceneID uuid.UUID) ([]*Tag, error)
	FindIdsBySceneIds(ids []uuid.UUID) ([][]uuid.UUID, []error)
	FindByIds(ids []uuid.UUID) ([]*Tag, []error)
	FindByName(name string) (*Tag, error)
	FindByNameOrAlias(name string) (*Tag, error)
	FindWithRedirect(id uuid.UUID) (*Tag, error)
	Count() (int, error)
	Query(input TagQueryInput) ([]*Tag, int, error)
	GetAliases(id uuid.UUID) ([]string, error)
	ApplyEdit(edit Edit, operation OperationEnum, tag *Tag) (*Tag, error)
	GetEditAliases(id *uuid.UUID, data *TagEdit) ([]string, error)
	SearchTags(term string, limit int) ([]*Tag, error)
}

type TagResolver added in v0.1.0

type TagResolver interface {
	Description(ctx context.Context, obj *Tag) (*string, error)
	Aliases(ctx context.Context, obj *Tag) ([]string, error)

	Edits(ctx context.Context, obj *Tag) ([]*Edit, error)
	Category(ctx context.Context, obj *Tag) (*TagCategory, error)
	Created(ctx context.Context, obj *Tag) (*time.Time, error)
	Updated(ctx context.Context, obj *Tag) (*time.Time, error)
}

type TagSortEnum added in v0.1.6

type TagSortEnum string
const (
	TagSortEnumName      TagSortEnum = "NAME"
	TagSortEnumCreatedAt TagSortEnum = "CREATED_AT"
	TagSortEnumUpdatedAt TagSortEnum = "UPDATED_AT"
)

func (TagSortEnum) IsValid added in v0.1.6

func (e TagSortEnum) IsValid() bool

func (TagSortEnum) MarshalGQL added in v0.1.6

func (e TagSortEnum) MarshalGQL(w io.Writer)

func (TagSortEnum) String added in v0.1.6

func (e TagSortEnum) String() string

func (*TagSortEnum) UnmarshalGQL added in v0.1.6

func (e *TagSortEnum) UnmarshalGQL(v interface{}) error

type TagUpdateInput added in v0.1.0

type TagUpdateInput struct {
	ID          uuid.UUID  `json:"id"`
	Name        *string    `json:"name,omitempty"`
	Description *string    `json:"description,omitempty"`
	Aliases     []string   `json:"aliases,omitempty"`
	CategoryID  *uuid.UUID `json:"category_id,omitempty"`
}

type Tags

type Tags []*Tag

func (*Tags) Add

func (p *Tags) Add(o interface{})

func (Tags) Each

func (p Tags) Each(fn func(interface{}))

type TargetTypeEnum added in v0.1.0

type TargetTypeEnum string
const (
	TargetTypeEnumScene     TargetTypeEnum = "SCENE"
	TargetTypeEnumStudio    TargetTypeEnum = "STUDIO"
	TargetTypeEnumPerformer TargetTypeEnum = "PERFORMER"
	TargetTypeEnumTag       TargetTypeEnum = "TAG"
)

func (TargetTypeEnum) IsValid added in v0.1.0

func (e TargetTypeEnum) IsValid() bool

func (TargetTypeEnum) MarshalGQL added in v0.1.0

func (e TargetTypeEnum) MarshalGQL(w io.Writer)

func (TargetTypeEnum) String added in v0.1.0

func (e TargetTypeEnum) String() string

func (*TargetTypeEnum) UnmarshalGQL added in v0.1.0

func (e *TargetTypeEnum) UnmarshalGQL(v interface{}) error

type URL

type URL struct {
	URL    string `json:"url"`
	SiteID uuid.UUID
}

func ParseURLInput added in v0.1.0

func ParseURLInput(input []*URLInput) []*URL

type URLInput

type URLInput struct {
	URL    string    `json:"url"`
	SiteID uuid.UUID `json:"site_id"`
}

func (*URLInput) ToURL added in v0.1.0

func (u *URLInput) ToURL() *URL

type URLResolver added in v0.1.0

type URLResolver interface {
	Type(ctx context.Context, obj *URL) (string, error)
	Site(ctx context.Context, obj *URL) (*Site, error)
}

type User

type User struct {
	ID           uuid.UUID     `db:"id" json:"id"`
	Name         string        `db:"name" json:"name"`
	PasswordHash string        `db:"password_hash" json:"password_hash"`
	Email        string        `db:"email" json:"email"`
	APIKey       string        `db:"api_key" json:"api_key"`
	APICalls     int           `db:"api_calls" json:"api_calls"`
	InviteTokens int           `db:"invite_tokens" json:"invite_tokens"`
	InvitedByID  uuid.NullUUID `db:"invited_by" json:"invited_by"`
	LastAPICall  time.Time     `db:"last_api_call" json:"last_api_call"`
	CreatedAt    time.Time     `db:"created_at" json:"created_at"`
	UpdatedAt    time.Time     `db:"updated_at" json:"updated_at"`
}

func (*User) CopyFromCreateInput

func (p *User) CopyFromCreateInput(input UserCreateInput) error

func (*User) CopyFromUpdateInput

func (p *User) CopyFromUpdateInput(input UserUpdateInput) error

func (User) GetID

func (p User) GetID() uuid.UUID

func (User) IsPasswordCorrect

func (p User) IsPasswordCorrect(pw string) bool

func (*User) SetPasswordHash

func (p *User) SetPasswordHash(pw string) error

type UserChangePasswordInput added in v0.1.0

type UserChangePasswordInput struct {
	// Password in plain text
	ExistingPassword *string `json:"existing_password,omitempty"`
	NewPassword      string  `json:"new_password"`
	ResetKey         *string `json:"reset_key,omitempty"`
}

type UserCreateInput added in v0.1.0

type UserCreateInput struct {
	Name string `json:"name"`
	// Password in plain text
	Password    string     `json:"password"`
	Roles       []RoleEnum `json:"roles"`
	Email       string     `json:"email"`
	InvitedByID *uuid.UUID `json:"invited_by_id,omitempty"`
}

type UserDestroyInput added in v0.1.0

type UserDestroyInput struct {
	ID uuid.UUID `json:"id"`
}

type UserEditCount added in v0.1.0

type UserEditCount struct {
	Accepted          int `json:"accepted"`
	Rejected          int `json:"rejected"`
	Pending           int `json:"pending"`
	ImmediateAccepted int `json:"immediate_accepted"`
	ImmediateRejected int `json:"immediate_rejected"`
	Failed            int `json:"failed"`
	Canceled          int `json:"canceled"`
}

type UserFinder

type UserFinder interface {
	Find(id uuid.UUID) (*User, error)
	FindByName(name string) (*User, error)
	FindByEmail(email string) (*User, error)
}

UserFinder is an interface to find and update User objects.

type UserQueryInput added in v0.1.6

type UserQueryInput struct {
	// Filter to search user name - assumes like query unless quoted
	Name *string `json:"name,omitempty"`
	// Filter to search email - assumes like query unless quoted
	Email *string `json:"email,omitempty"`
	// Filter by roles
	Roles *RoleCriterionInput `json:"roles,omitempty"`
	// Filter by api key
	APIKey *string `json:"apiKey,omitempty"`
	// Filter by successful edits
	SuccessfulEdits *IntCriterionInput `json:"successful_edits,omitempty"`
	// Filter by unsuccessful edits
	UnsuccessfulEdits *IntCriterionInput `json:"unsuccessful_edits,omitempty"`
	// Filter by votes on successful edits
	SuccessfulVotes *IntCriterionInput `json:"successful_votes,omitempty"`
	// Filter by votes on unsuccessful edits
	UnsuccessfulVotes *IntCriterionInput `json:"unsuccessful_votes,omitempty"`
	// Filter by number of API calls
	APICalls *IntCriterionInput `json:"api_calls,omitempty"`
	// Filter by user that invited
	InvitedBy *uuid.UUID `json:"invited_by,omitempty"`
	Page      int        `json:"page"`
	PerPage   int        `json:"per_page"`
}

type UserRepo

type UserRepo interface {
	UserFinder

	Create(newUser User) (*User, error)
	Update(updatedUser User) (*User, error)
	UpdateFull(updatedUser User) (*User, error)
	Destroy(id uuid.UUID) error
	CreateRoles(newJoins UserRoles) error
	UpdateRoles(userID uuid.UUID, updatedJoins UserRoles) error

	Count() (int, error)
	Query(filter UserQueryInput) (Users, int, error)
	GetRoles(id uuid.UUID) (UserRoles, error)
	CountVotesByType(id uuid.UUID) (*UserVoteCount, error)
	CountEditsByStatus(id uuid.UUID) (*UserEditCount, error)
}

type UserResolver added in v0.1.0

type UserResolver interface {
	Roles(ctx context.Context, obj *User) ([]RoleEnum, error)

	VoteCount(ctx context.Context, obj *User) (*UserVoteCount, error)
	EditCount(ctx context.Context, obj *User) (*UserEditCount, error)

	InvitedBy(ctx context.Context, obj *User) (*User, error)

	ActiveInviteCodes(ctx context.Context, obj *User) ([]string, error)
	InviteCodes(ctx context.Context, obj *User) ([]*InviteKey, error)
}

type UserRole

type UserRole struct {
	UserID uuid.UUID `db:"user_id" json:"user_id"`
	Role   string    `db:"role" json:"role"`
}

type UserRoles

type UserRoles []*UserRole

func CreateUserRoles

func CreateUserRoles(userID uuid.UUID, roles []RoleEnum) UserRoles

func (*UserRoles) Add

func (p *UserRoles) Add(o interface{})

func (UserRoles) Each

func (p UserRoles) Each(fn func(interface{}))

func (UserRoles) ToRoles

func (p UserRoles) ToRoles() []RoleEnum

type UserUpdateInput added in v0.1.0

type UserUpdateInput struct {
	ID   uuid.UUID `json:"id"`
	Name *string   `json:"name,omitempty"`
	// Password in plain text
	Password *string    `json:"password,omitempty"`
	Roles    []RoleEnum `json:"roles,omitempty"`
	Email    *string    `json:"email,omitempty"`
}

type UserVoteCount added in v0.1.0

type UserVoteCount struct {
	Abstain         int `json:"abstain"`
	Accept          int `json:"accept"`
	Reject          int `json:"reject"`
	ImmediateAccept int `json:"immediate_accept"`
	ImmediateReject int `json:"immediate_reject"`
}

type UserVotedFilterEnum added in v0.4.0

type UserVotedFilterEnum string
const (
	UserVotedFilterEnumAbstain  UserVotedFilterEnum = "ABSTAIN"
	UserVotedFilterEnumAccept   UserVotedFilterEnum = "ACCEPT"
	UserVotedFilterEnumReject   UserVotedFilterEnum = "REJECT"
	UserVotedFilterEnumNotVoted UserVotedFilterEnum = "NOT_VOTED"
)

func (UserVotedFilterEnum) IsValid added in v0.4.0

func (e UserVotedFilterEnum) IsValid() bool

func (UserVotedFilterEnum) MarshalGQL added in v0.4.0

func (e UserVotedFilterEnum) MarshalGQL(w io.Writer)

func (UserVotedFilterEnum) String added in v0.4.0

func (e UserVotedFilterEnum) String() string

func (*UserVotedFilterEnum) UnmarshalGQL added in v0.4.0

func (e *UserVotedFilterEnum) UnmarshalGQL(v interface{}) error

type Users

type Users []*User

func (*Users) Add

func (p *Users) Add(o interface{})

func (Users) Each

func (p Users) Each(fn func(interface{}))

type ValidSiteTypeEnum added in v0.1.0

type ValidSiteTypeEnum string
const (
	ValidSiteTypeEnumPerformer ValidSiteTypeEnum = "PERFORMER"
	ValidSiteTypeEnumScene     ValidSiteTypeEnum = "SCENE"
	ValidSiteTypeEnumStudio    ValidSiteTypeEnum = "STUDIO"
)

func (ValidSiteTypeEnum) IsValid added in v0.1.0

func (e ValidSiteTypeEnum) IsValid() bool

func (ValidSiteTypeEnum) MarshalGQL added in v0.1.0

func (e ValidSiteTypeEnum) MarshalGQL(w io.Writer)

func (ValidSiteTypeEnum) String added in v0.1.0

func (e ValidSiteTypeEnum) String() string

func (*ValidSiteTypeEnum) UnmarshalGQL added in v0.1.0

func (e *ValidSiteTypeEnum) UnmarshalGQL(v interface{}) error

type Version added in v0.1.0

type Version struct {
	Hash      string `json:"hash"`
	BuildTime string `json:"build_time"`
	BuildType string `json:"build_type"`
	Version   string `json:"version"`
}

type VoteStatusEnum added in v0.1.0

type VoteStatusEnum string
const (
	VoteStatusEnumAccepted          VoteStatusEnum = "ACCEPTED"
	VoteStatusEnumRejected          VoteStatusEnum = "REJECTED"
	VoteStatusEnumPending           VoteStatusEnum = "PENDING"
	VoteStatusEnumImmediateAccepted VoteStatusEnum = "IMMEDIATE_ACCEPTED"
	VoteStatusEnumImmediateRejected VoteStatusEnum = "IMMEDIATE_REJECTED"
	VoteStatusEnumFailed            VoteStatusEnum = "FAILED"
	VoteStatusEnumCanceled          VoteStatusEnum = "CANCELED"
)

func (VoteStatusEnum) IsValid added in v0.1.0

func (e VoteStatusEnum) IsValid() bool

func (VoteStatusEnum) MarshalGQL added in v0.1.0

func (e VoteStatusEnum) MarshalGQL(w io.Writer)

func (VoteStatusEnum) String added in v0.1.0

func (e VoteStatusEnum) String() string

func (*VoteStatusEnum) UnmarshalGQL added in v0.1.0

func (e *VoteStatusEnum) UnmarshalGQL(v interface{}) error

type VoteTypeEnum added in v0.1.0

type VoteTypeEnum string
const (
	VoteTypeEnumAbstain VoteTypeEnum = "ABSTAIN"
	VoteTypeEnumAccept  VoteTypeEnum = "ACCEPT"
	VoteTypeEnumReject  VoteTypeEnum = "REJECT"
	// Immediately accepts the edit - bypassing the vote
	VoteTypeEnumImmediateAccept VoteTypeEnum = "IMMEDIATE_ACCEPT"
	// Immediately rejects the edit - bypassing the vote
	VoteTypeEnumImmediateReject VoteTypeEnum = "IMMEDIATE_REJECT"
)

func (VoteTypeEnum) IsValid added in v0.1.0

func (e VoteTypeEnum) IsValid() bool

func (VoteTypeEnum) MarshalGQL added in v0.1.0

func (e VoteTypeEnum) MarshalGQL(w io.Writer)

func (VoteTypeEnum) String added in v0.1.0

func (e VoteTypeEnum) String() string

func (*VoteTypeEnum) UnmarshalGQL added in v0.1.0

func (e *VoteTypeEnum) UnmarshalGQL(v interface{}) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL