Documentation
¶
Index ¶
- Constants
- func CopyFull(target interface{}, source interface{})
- func ProcessSlice(current EditSlice, added EditSlice, removed EditSlice) error
- type BodyModification
- type BodyModificationInput
- type Edit
- type EditComment
- type EditComments
- type EditData
- type EditPerformer
- type EditPerformers
- type EditRepo
- type EditSlice
- type EditSliceValue
- type EditTag
- type EditTags
- type Edits
- type Image
- type ImageCreator
- type ImageDestroyer
- type ImageFinder
- type ImageRepo
- type Images
- type InviteKey
- type InviteKeyCreator
- type InviteKeyDestroyer
- type InviteKeyFinder
- type InviteKeyRepo
- type InviteKeys
- type JSONTime
- type JoinsRepo
- type NotFoundError
- type PendingActivation
- type PendingActivationCreator
- type PendingActivationFinder
- type PendingActivationRepo
- type PendingActivations
- type Performer
- func (p *Performer) CopyFromCreateInput(input PerformerCreateInput) error
- func (p *Performer) CopyFromPerformerEdit(input PerformerEdit, old PerformerEdit)
- func (p *Performer) CopyFromUpdateInput(input PerformerUpdateInput) error
- func (p Performer) GetID() uuid.UUID
- func (p *Performer) IsEditTarget()
- func (p Performer) ResolveBirthdate() FuzzyDate
- func (p Performer) ResolveMeasurements() Measurements
- func (p *Performer) ValidateModifyEdit(edit PerformerEditData) error
- type PerformerAlias
- type PerformerAliases
- func (p *PerformerAliases) Add(o interface{})
- func (p *PerformerAliases) AddAliases(newAliases []*PerformerAlias) error
- func (p PerformerAliases) Each(fn func(interface{}))
- func (p PerformerAliases) EachPtr(fn func(interface{}))
- func (p *PerformerAliases) Remove(id string)
- func (p *PerformerAliases) RemoveAliases(oldAliases []string) error
- func (p PerformerAliases) ToAliases() []string
- type PerformerBodyMod
- type PerformerBodyMods
- type PerformerEdit
- type PerformerEditData
- type PerformerImage
- type PerformerRedirect
- type PerformerRedirects
- type PerformerRepo
- type PerformerScene
- type PerformerStudio
- type PerformerURL
- type PerformerURLs
- type Performers
- type PerformersImages
- type PerformersScenes
- type Repo
- type SQLiteDate
- type SQLiteTimestamp
- type Scene
- type SceneFingerprint
- type SceneFingerprints
- type SceneImage
- type SceneRepo
- type SceneTag
- type SceneURL
- type SceneURLs
- type Scenes
- type ScenesImages
- type ScenesTags
- type Studio
- type StudioImage
- type StudioRepo
- type StudioURL
- type StudioURLs
- type Studios
- type StudiosImages
- type Tag
- type TagAlias
- type TagAliases
- type TagCategories
- type TagCategory
- type TagCategoryRepo
- type TagEdit
- type TagEditData
- type TagRedirect
- type TagRepo
- type Tags
- type URL
- type URLInput
- type User
- type UserFinder
- type UserRepo
- type UserRole
- type UserRoles
- type Users
Constants ¶
View Source
const ( PendingActivationTypeNewUser = "newUser" PendingActivationTypeResetPassword = "resetPassword" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BodyModification ¶
type BodyModificationInput ¶
type BodyModificationInput = BodyModification
type Edit ¶
type Edit struct { ID uuid.UUID `db:"id" json:"id"` UserID uuid.UUID `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"` CreatedAt SQLiteTimestamp `db:"created_at" json:"created_at"` UpdatedAt SQLiteTimestamp `db:"updated_at" json:"updated_at"` }
func (*Edit) GetPerformerData ¶
func (e *Edit) GetPerformerData() (*PerformerEditData, error)
func (*Edit) GetTagData ¶
func (e *Edit) GetTagData() (*TagEditData, error)
func (*Edit) ImmediateAccept ¶
func (e *Edit) ImmediateAccept()
func (*Edit) ImmediateReject ¶
func (e *Edit) ImmediateReject()
type EditComment ¶
type EditComment struct { ID uuid.UUID `db:"id" json:"id"` EditID uuid.UUID `db:"edit_id" json:"edit_id"` UserID uuid.UUID `db:"user_id" json:"user_id"` CreatedAt SQLiteTimestamp `db:"created_at" json:"created_at"` Text string `db:"text" json:"text"` }
func NewEditComment ¶
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 []string `json:"merge_sources,omitempty"` }
type EditPerformer ¶
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 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 FindTagID(id uuid.UUID) (*uuid.UUID, error) FindPerformerID(id uuid.UUID) (*uuid.UUID, error) Count() (int, error) Query(editFilter *EditFilterType, findFilter *QuerySpec) ([]*Edit, int) CreateComment(newJoin EditComment) error GetComments(id uuid.UUID) (EditComments, error) FindByTagID(id uuid.UUID) ([]*Edit, error) FindByPerformerID(id uuid.UUID) ([]*Edit, error) }
type EditSlice ¶
type EditSlice interface { Each(fn func(interface{})) EachPtr(fn func(interface{})) Add(o interface{}) Remove(v string) }
type EditSliceValue ¶
type EditSliceValue interface {
ID() string
}
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) IsEditTarget ¶
func (p *Image) IsEditTarget()
type ImageCreator ¶
type ImageDestroyer ¶
type ImageFinder ¶
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 Images ¶
type Images []*Image
func (Images) OrderLandscape ¶
func (p Images) OrderLandscape()
func (Images) OrderPortrait ¶
func (p Images) OrderPortrait()
func (Images) ToURLSlice ¶
type InviteKey ¶
type InviteKey struct { ID uuid.UUID `db:"id" json:"id"` GeneratedBy uuid.UUID `db:"generated_by" json:"generated_by"` GeneratedAt SQLiteTimestamp `db:"generated_at" json:"generated_at"` }
type InviteKeyCreator ¶
type InviteKeyDestroyer ¶
type InviteKeyDestroyer interface { InviteKeyFinder Destroy(id uuid.UUID) error }
type InviteKeyFinder ¶
type InviteKeyRepo ¶
type InviteKeyRepo interface { InviteKeyFinder InviteKeyCreator InviteKeyDestroyer }
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 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 }
type NotFoundError ¶
NotFoundError indicates that an object with the given id was not found.
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
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 SQLiteTimestamp `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 SQLiteDate `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 SQLiteTimestamp `db:"created_at" json:"created_at"` UpdatedAt SQLiteTimestamp `db:"updated_at" json:"updated_at"` Deleted bool `db:"deleted" json:"deleted"` }
func (*Performer) CopyFromCreateInput ¶
func (*Performer) CopyFromPerformerEdit ¶
func (p *Performer) CopyFromPerformerEdit(input PerformerEdit, old PerformerEdit)
func (*Performer) CopyFromUpdateInput ¶
func (*Performer) IsEditTarget ¶
func (p *Performer) IsEditTarget()
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 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 PerformerEdit ¶
type PerformerEdit struct { 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 []string `json:"added_images,omitempty"` RemovedImages []string `json:"removed_images,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 []string `json:"merge_sources,omitempty"` SetModifyAliases bool `json:"modify_aliases,omitempty"` SetMergeAliases bool `json:"merge_aliases,omitempty"` }
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 PerformerRedirect ¶
type PerformerRedirects ¶
type PerformerRedirects []*PerformerRedirect
func (*PerformerRedirects) Add ¶
func (p *PerformerRedirects) Add(o interface{})
func (PerformerRedirects) Each ¶
func (p PerformerRedirects) Each(fn func(interface{}))
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 CreateImages(newJoins PerformersImages) error UpdateImages(performerID uuid.UUID, updatedJoins PerformersImages) 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) FindBySceneID(sceneID uuid.UUID) (Performers, error) FindByNames(names []string) (Performers, error) FindByAliases(names []string) (Performers, error) FindByName(name string) (Performers, error) FindByAlias(name string) (Performers, error) Count() (int, error) Query(performerFilter *PerformerFilterType, findFilter *QuerySpec) ([]*Performer, int) 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) DeleteScenePerformers(id uuid.UUID) error SoftDelete(performer Performer) (*Performer, error) CreateRedirect(newJoin PerformerRedirect) error UpdateRedirects(oldTargetID uuid.UUID, newTargetID uuid.UUID) error UpdateScenePerformers(oldPerformer *Performer, newTargetID uuid.UUID, setAliases bool) error UpdateScenePerformerAlias(performerID uuid.UUID, name string) error MergeInto(sourceID uuid.UUID, targetID uuid.UUID, setAliases bool) error ApplyEdit(edit Edit, operation OperationEnum, performer *Performer) (*Performer, error) ApplyModifyEdit(performer *Performer, data *PerformerEditData) (*Performer, error) FindMergeIDsByPerformerIDs(ids []uuid.UUID) ([][]uuid.UUID, []error) }
type PerformerScene ¶
type PerformerStudio ¶
type PerformerURL ¶
type PerformerURL struct { PerformerID uuid.UUID `db:"performer_id" json:"performer_id"` URL string `db:"url" json:"url"` Type string `db:"type" json:"type"` }
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 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 []string) 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{}))
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 }
type SQLiteDate ¶
func (SQLiteDate) IsValid ¶
func (t SQLiteDate) IsValid() bool
func (*SQLiteDate) Scan ¶
func (t *SQLiteDate) Scan(value interface{}) error
Scan implements the Scanner interface.
type SQLiteTimestamp ¶
func (SQLiteTimestamp) IsValid ¶
func (t SQLiteTimestamp) IsValid() bool
func (*SQLiteTimestamp) Scan ¶
func (t *SQLiteTimestamp) Scan(value interface{}) error
Scan implements the Scanner 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 SQLiteDate `db:"date" json:"date"` StudioID uuid.NullUUID `db:"studio_id,omitempty" json:"studio_id"` CreatedAt SQLiteTimestamp `db:"created_at" json:"created_at"` UpdatedAt SQLiteTimestamp `db:"updated_at" json:"updated_at"` Duration sql.NullInt64 `db:"duration" json:"duration"` Director sql.NullString `db:"director" json:"director"` Deleted bool `db:"deleted" json:"deleted"` }
func (*Scene) CopyFromCreateInput ¶
func (p *Scene) CopyFromCreateInput(input SceneCreateInput)
func (*Scene) CopyFromUpdateInput ¶
func (p *Scene) CopyFromUpdateInput(input SceneUpdateInput)
func (*Scene) IsEditTarget ¶
func (p *Scene) IsEditTarget()
type SceneFingerprint ¶
type SceneFingerprint struct { SceneID uuid.UUID `db:"scene_id" json:"scene_id"` Hash string `db:"hash" json:"hash"` Algorithm string `db:"algorithm" json:"algorithm"` Duration int `db:"duration" json:"duration"` Submissions int `db:"submissions" json:"submissions"` CreatedAt SQLiteTimestamp `db:"created_at" json:"created_at"` UpdatedAt SQLiteTimestamp `db:"updated_at" json:"updated_at"` }
func (SceneFingerprint) ToFingerprint ¶
func (p SceneFingerprint) ToFingerprint() *Fingerprint
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 (p *SceneFingerprints) Add(o interface{})
func (SceneFingerprints) Each ¶
func (p SceneFingerprints) Each(fn func(interface{}))
func (SceneFingerprints) ToFingerprints ¶
func (p SceneFingerprints) ToFingerprints() []*Fingerprint
type SceneImage ¶
type SceneRepo ¶
type SceneRepo interface { Create(newScene Scene) (*Scene, error) Update(updatedScene Scene) (*Scene, error) Destroy(id uuid.UUID) error CreateURLs(newJoins SceneURLs) error UpdateURLs(scene uuid.UUID, updatedJoins SceneURLs) error CreateFingerprints(newJoins SceneFingerprints) error UpdateFingerprints(sceneID uuid.UUID, updatedJoins SceneFingerprints) error Find(id uuid.UUID) (*Scene, error) FindByFingerprint(algorithm FingerprintAlgorithm, hash string) ([]*Scene, error) FindByFingerprints(fingerprints []string) ([]*Scene, error) FindByFullFingerprints(fingerprints []*FingerprintQueryInput) ([]*Scene, error) FindByTitle(name string) ([]*Scene, error) Count() (int, error) Query(sceneFilter *SceneFilterType, findFilter *QuerySpec) ([]*Scene, int) GetFingerprints(id uuid.UUID) ([]*Fingerprint, error) GetAllFingerprints(ids []uuid.UUID) ([][]*Fingerprint, []error) GetPerformers(id uuid.UUID) (PerformersScenes, error) GetAllAppearances(ids []uuid.UUID) ([]PerformersScenes, []error) GetURLs(id uuid.UUID) (SceneURLs, error) GetAllURLs(ids []uuid.UUID) ([][]*URL, []error) SearchScenes(term string, limit int) ([]*Scene, error) CountByPerformer(id uuid.UUID) (int, error) }
type SceneURL ¶
type ScenesImages ¶
type ScenesImages []*SceneImage
func CreateSceneImages ¶
func CreateSceneImages(sceneID uuid.UUID, imageIds []string) ScenesImages
func (*ScenesImages) Add ¶
func (p *ScenesImages) Add(o interface{})
func (ScenesImages) Each ¶
func (p ScenesImages) Each(fn func(interface{}))
type ScenesTags ¶
type ScenesTags []*SceneTag
func CreateSceneTags ¶
func CreateSceneTags(sceneID uuid.UUID, tagIds []string) ScenesTags
func (*ScenesTags) Add ¶
func (p *ScenesTags) Add(o interface{})
func (ScenesTags) Each ¶
func (p ScenesTags) Each(fn func(interface{}))
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 SQLiteTimestamp `db:"created_at" json:"created_at"` UpdatedAt SQLiteTimestamp `db:"updated_at" json:"updated_at"` Deleted bool `db:"deleted" json:"deleted"` }
func (*Studio) CopyFromCreateInput ¶
func (p *Studio) CopyFromCreateInput(input StudioCreateInput)
func (*Studio) CopyFromUpdateInput ¶
func (p *Studio) CopyFromUpdateInput(input StudioUpdateInput)
func (*Studio) IsEditTarget ¶
func (p *Studio) IsEditTarget()
type StudioImage ¶
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) FindBySceneID(sceneID int) (Studios, error) FindByNames(names []string) (Studios, error) FindByName(name string) (*Studio, error) FindByParentID(id uuid.UUID) (Studios, error) Count() (int, error) Query(studioFilter *StudioFilterType, findFilter *QuerySpec) (Studios, int) GetURLs(id uuid.UUID) (StudioURLs, error) GetAllURLs(ids []uuid.UUID) ([][]*URL, []error) CountByPerformer(performerID uuid.UUID) ([]*PerformerStudio, error) }
type StudioURL ¶
type StudioURLs ¶
type StudioURLs []*StudioURL
func CreateStudioURLs ¶
func CreateStudioURLs(studioID uuid.UUID, urls []*URLInput) StudioURLs
func (*StudioURLs) Add ¶
func (p *StudioURLs) Add(o interface{})
func (StudioURLs) Each ¶
func (p StudioURLs) Each(fn func(interface{}))
type StudiosImages ¶
type StudiosImages []*StudioImage
func CreateStudioImages ¶
func CreateStudioImages(studioID uuid.UUID, imageIds []string) StudiosImages
func (*StudiosImages) Add ¶
func (p *StudiosImages) Add(o interface{})
func (StudiosImages) Each ¶
func (p StudiosImages) Each(fn func(interface{}))
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 SQLiteTimestamp `db:"created_at" json:"created_at"` UpdatedAt SQLiteTimestamp `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 (*Tag) CopyFromUpdateInput ¶
func (p *Tag) CopyFromUpdateInput(input TagUpdateInput)
func (*Tag) IsEditTarget ¶
func (p *Tag) IsEditTarget()
func (*Tag) ValidateModifyEdit ¶
func (p *Tag) ValidateModifyEdit(edit TagEditData) error
type 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 SQLiteTimestamp `db:"created_at" json:"created_at"` UpdatedAt SQLiteTimestamp `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 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(findFilter *QuerySpec) ([]*TagCategory, int, error) }
type TagEdit ¶
type TagEdit struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` AddedAliases []string `json:"added_aliases,omitempty"` RemovedAliases []string `json:"removed_aliases,omitempty"` CategoryID *string `json:"category_id,omitempty"` }
func (TagEdit) IsEditDetails ¶
func (TagEdit) IsEditDetails()
type TagEditData ¶
type TagRedirect ¶
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 DeleteSceneTags(id uuid.UUID) error SoftDelete(tag Tag) (*Tag, error) CreateRedirect(newJoin TagRedirect) error UpdateRedirects(oldTargetID uuid.UUID, newTargetID uuid.UUID) error UpdateSceneTags(oldTargetID uuid.UUID, newTargetID uuid.UUID) error CreateAliases(newJoins TagAliases) error UpdateAliases(tagID uuid.UUID, updatedJoins TagAliases) error Find(id uuid.UUID) (*Tag, error) FindByNameOrAlias(name string) (*Tag, error) FindBySceneID(sceneID uuid.UUID) ([]*Tag, error) FindIdsBySceneIds(ids []uuid.UUID) ([][]uuid.UUID, []error) FindByIds(ids []uuid.UUID) ([]*Tag, []error) FindByNames(names []string) ([]*Tag, error) FindByAliases(names []string) ([]*Tag, error) FindByName(name string) (*Tag, error) FindByAlias(name string) ([]*Tag, error) Count() (int, error) Query(tagFilter *TagFilterType, findFilter *QuerySpec) ([]*Tag, int, error) GetRawAliases(id uuid.UUID) (TagAliases, error) GetAliases(id uuid.UUID) ([]string, error) MergeInto(sourceID uuid.UUID, targetID uuid.UUID) error ApplyEdit(edit Edit, operation OperationEnum, tag *Tag) (*Tag, 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 SQLiteTimestamp `db:"last_api_call" json:"last_api_call"` CreatedAt SQLiteTimestamp `db:"created_at" json:"created_at"` UpdatedAt SQLiteTimestamp `db:"updated_at" json:"updated_at"` }
func (*User) CopyFromCreateInput ¶
func (*User) CopyFromUpdateInput ¶
func (User) IsPasswordCorrect ¶
func (*User) SetPasswordHash ¶
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 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(studioID uuid.UUID, updatedJoins UserRoles) error Count() (int, error) Query(userFilter *UserFilterType, findFilter *QuerySpec) (Users, int) GetRoles(id uuid.UUID) (UserRoles, error) }
Source Files
¶
- activation.go
- edit.go
- errors.go
- extension_edit_details.go
- extension_query_spec.go
- extension_role_enum.go
- factory.go
- image.go
- invite_key.go
- joins.go
- json_time.go
- model_edit.go
- model_image.go
- model_joins.go
- model_pending_activation.go
- model_performer.go
- model_scene.go
- model_studio.go
- model_tag.go
- model_tag_category.go
- models_invite_key.go
- models_user.go
- performer.go
- scene.go
- sql_translate.go
- sqlite_date.go
- sqlite_timestamp.go
- studio.go
- tag.go
- tag_category.go
- user.go
Click to show internal directories.
Click to hide internal directories.