Documentation
¶
Index ¶
- func GetLoadersKey() contextKey
- func Middleware(getRepo func(ctx context.Context) models.Repo) func(next http.Handler) http.Handler
- type BodyModificationsLoader
- func (l *BodyModificationsLoader) Clear(key uuid.UUID)
- func (l *BodyModificationsLoader) Load(key uuid.UUID) ([]*models.BodyModification, error)
- func (l *BodyModificationsLoader) LoadAll(keys []uuid.UUID) ([][]*models.BodyModification, []error)
- func (l *BodyModificationsLoader) LoadAllThunk(keys []uuid.UUID) func() ([][]*models.BodyModification, []error)
- func (l *BodyModificationsLoader) LoadThunk(key uuid.UUID) func() ([]*models.BodyModification, error)
- func (l *BodyModificationsLoader) Prime(key uuid.UUID, value []*models.BodyModification) bool
- type BodyModificationsLoaderConfig
- type BoolsLoader
- func (l *BoolsLoader) Clear(key uuid.UUID)
- func (l *BoolsLoader) Load(key uuid.UUID) (bool, error)
- func (l *BoolsLoader) LoadAll(keys []uuid.UUID) ([]bool, []error)
- func (l *BoolsLoader) LoadAllThunk(keys []uuid.UUID) func() ([]bool, []error)
- func (l *BoolsLoader) LoadThunk(key uuid.UUID) func() (bool, error)
- func (l *BoolsLoader) Prime(key uuid.UUID, value bool) bool
- type BoolsLoaderConfig
- type EditCommentLoader
- func (l *EditCommentLoader) Clear(key uuid.UUID)
- func (l *EditCommentLoader) Load(key uuid.UUID) (*models.EditComment, error)
- func (l *EditCommentLoader) LoadAll(keys []uuid.UUID) ([]*models.EditComment, []error)
- func (l *EditCommentLoader) LoadAllThunk(keys []uuid.UUID) func() ([]*models.EditComment, []error)
- func (l *EditCommentLoader) LoadThunk(key uuid.UUID) func() (*models.EditComment, error)
- func (l *EditCommentLoader) Prime(key uuid.UUID, value *models.EditComment) bool
- type EditCommentLoaderConfig
- type EditLoader
- func (l *EditLoader) Clear(key uuid.UUID)
- func (l *EditLoader) Load(key uuid.UUID) (*models.Edit, error)
- func (l *EditLoader) LoadAll(keys []uuid.UUID) ([]*models.Edit, []error)
- func (l *EditLoader) LoadAllThunk(keys []uuid.UUID) func() ([]*models.Edit, []error)
- func (l *EditLoader) LoadThunk(key uuid.UUID) func() (*models.Edit, error)
- func (l *EditLoader) Prime(key uuid.UUID, value *models.Edit) bool
- type EditLoaderConfig
- type FingerprintsLoader
- func (l *FingerprintsLoader) Clear(key uuid.UUID)
- func (l *FingerprintsLoader) Load(key uuid.UUID) ([]*models.Fingerprint, error)
- func (l *FingerprintsLoader) LoadAll(keys []uuid.UUID) ([][]*models.Fingerprint, []error)
- func (l *FingerprintsLoader) LoadAllThunk(keys []uuid.UUID) func() ([][]*models.Fingerprint, []error)
- func (l *FingerprintsLoader) LoadThunk(key uuid.UUID) func() ([]*models.Fingerprint, error)
- func (l *FingerprintsLoader) Prime(key uuid.UUID, value []*models.Fingerprint) bool
- type FingerprintsLoaderConfig
- type ImageLoader
- func (l *ImageLoader) Clear(key uuid.UUID)
- func (l *ImageLoader) Load(key uuid.UUID) (*models.Image, error)
- func (l *ImageLoader) LoadAll(keys []uuid.UUID) ([]*models.Image, []error)
- func (l *ImageLoader) LoadAllThunk(keys []uuid.UUID) func() ([]*models.Image, []error)
- func (l *ImageLoader) LoadThunk(key uuid.UUID) func() (*models.Image, error)
- func (l *ImageLoader) Prime(key uuid.UUID, value *models.Image) bool
- type ImageLoaderConfig
- type Loaders
- type PerformerLoader
- func (l *PerformerLoader) Clear(key uuid.UUID)
- func (l *PerformerLoader) Load(key uuid.UUID) (*models.Performer, error)
- func (l *PerformerLoader) LoadAll(keys []uuid.UUID) ([]*models.Performer, []error)
- func (l *PerformerLoader) LoadAllThunk(keys []uuid.UUID) func() ([]*models.Performer, []error)
- func (l *PerformerLoader) LoadThunk(key uuid.UUID) func() (*models.Performer, error)
- func (l *PerformerLoader) Prime(key uuid.UUID, value *models.Performer) bool
- type PerformerLoaderConfig
- type SceneAppearancesLoader
- func (l *SceneAppearancesLoader) Clear(key uuid.UUID)
- func (l *SceneAppearancesLoader) Load(key uuid.UUID) (models.PerformersScenes, error)
- func (l *SceneAppearancesLoader) LoadAll(keys []uuid.UUID) ([]models.PerformersScenes, []error)
- func (l *SceneAppearancesLoader) LoadAllThunk(keys []uuid.UUID) func() ([]models.PerformersScenes, []error)
- func (l *SceneAppearancesLoader) LoadThunk(key uuid.UUID) func() (models.PerformersScenes, error)
- func (l *SceneAppearancesLoader) Prime(key uuid.UUID, value models.PerformersScenes) bool
- type SceneAppearancesLoaderConfig
- type SceneLoader
- func (l *SceneLoader) Clear(key uuid.UUID)
- func (l *SceneLoader) Load(key uuid.UUID) (*models.Scene, error)
- func (l *SceneLoader) LoadAll(keys []uuid.UUID) ([]*models.Scene, []error)
- func (l *SceneLoader) LoadAllThunk(keys []uuid.UUID) func() ([]*models.Scene, []error)
- func (l *SceneLoader) LoadThunk(key uuid.UUID) func() (*models.Scene, error)
- func (l *SceneLoader) Prime(key uuid.UUID, value *models.Scene) bool
- type SceneLoaderConfig
- type SiteLoader
- func (l *SiteLoader) Clear(key uuid.UUID)
- func (l *SiteLoader) Load(key uuid.UUID) (*models.Site, error)
- func (l *SiteLoader) LoadAll(keys []uuid.UUID) ([]*models.Site, []error)
- func (l *SiteLoader) LoadAllThunk(keys []uuid.UUID) func() ([]*models.Site, []error)
- func (l *SiteLoader) LoadThunk(key uuid.UUID) func() (*models.Site, error)
- func (l *SiteLoader) Prime(key uuid.UUID, value *models.Site) bool
- type SiteLoaderConfig
- type StringsLoader
- func (l *StringsLoader) Clear(key uuid.UUID)
- func (l *StringsLoader) Load(key uuid.UUID) ([]string, error)
- func (l *StringsLoader) LoadAll(keys []uuid.UUID) ([][]string, []error)
- func (l *StringsLoader) LoadAllThunk(keys []uuid.UUID) func() ([][]string, []error)
- func (l *StringsLoader) LoadThunk(key uuid.UUID) func() ([]string, error)
- func (l *StringsLoader) Prime(key uuid.UUID, value []string) bool
- type StringsLoaderConfig
- type StudioLoader
- func (l *StudioLoader) Clear(key uuid.UUID)
- func (l *StudioLoader) Load(key uuid.UUID) (*models.Studio, error)
- func (l *StudioLoader) LoadAll(keys []uuid.UUID) ([]*models.Studio, []error)
- func (l *StudioLoader) LoadAllThunk(keys []uuid.UUID) func() ([]*models.Studio, []error)
- func (l *StudioLoader) LoadThunk(key uuid.UUID) func() (*models.Studio, error)
- func (l *StudioLoader) Prime(key uuid.UUID, value *models.Studio) bool
- type StudioLoaderConfig
- type SubmittedFingerprintsLoader
- func (l *SubmittedFingerprintsLoader) Clear(key uuid.UUID)
- func (l *SubmittedFingerprintsLoader) Load(key uuid.UUID) ([]*models.Fingerprint, error)
- func (l *SubmittedFingerprintsLoader) LoadAll(keys []uuid.UUID) ([][]*models.Fingerprint, []error)
- func (l *SubmittedFingerprintsLoader) LoadAllThunk(keys []uuid.UUID) func() ([][]*models.Fingerprint, []error)
- func (l *SubmittedFingerprintsLoader) LoadThunk(key uuid.UUID) func() ([]*models.Fingerprint, error)
- func (l *SubmittedFingerprintsLoader) Prime(key uuid.UUID, value []*models.Fingerprint) bool
- type SubmittedFingerprintsLoaderConfig
- type TagCategoryLoader
- func (l *TagCategoryLoader) Clear(key uuid.UUID)
- func (l *TagCategoryLoader) Load(key uuid.UUID) (*models.TagCategory, error)
- func (l *TagCategoryLoader) LoadAll(keys []uuid.UUID) ([]*models.TagCategory, []error)
- func (l *TagCategoryLoader) LoadAllThunk(keys []uuid.UUID) func() ([]*models.TagCategory, []error)
- func (l *TagCategoryLoader) LoadThunk(key uuid.UUID) func() (*models.TagCategory, error)
- func (l *TagCategoryLoader) Prime(key uuid.UUID, value *models.TagCategory) bool
- type TagCategoryLoaderConfig
- type TagLoader
- func (l *TagLoader) Clear(key uuid.UUID)
- func (l *TagLoader) Load(key uuid.UUID) (*models.Tag, error)
- func (l *TagLoader) LoadAll(keys []uuid.UUID) ([]*models.Tag, []error)
- func (l *TagLoader) LoadAllThunk(keys []uuid.UUID) func() ([]*models.Tag, []error)
- func (l *TagLoader) LoadThunk(key uuid.UUID) func() (*models.Tag, error)
- func (l *TagLoader) Prime(key uuid.UUID, value *models.Tag) bool
- type TagLoaderConfig
- type URLLoader
- func (l *URLLoader) Clear(key uuid.UUID)
- func (l *URLLoader) Load(key uuid.UUID) ([]*models.URL, error)
- func (l *URLLoader) LoadAll(keys []uuid.UUID) ([][]*models.URL, []error)
- func (l *URLLoader) LoadAllThunk(keys []uuid.UUID) func() ([][]*models.URL, []error)
- func (l *URLLoader) LoadThunk(key uuid.UUID) func() ([]*models.URL, error)
- func (l *URLLoader) Prime(key uuid.UUID, value []*models.URL) bool
- type URLLoaderConfig
- type UUIDsLoader
- func (l *UUIDsLoader) Clear(key uuid.UUID)
- func (l *UUIDsLoader) Load(key uuid.UUID) ([]uuid.UUID, error)
- func (l *UUIDsLoader) LoadAll(keys []uuid.UUID) ([][]uuid.UUID, []error)
- func (l *UUIDsLoader) LoadAllThunk(keys []uuid.UUID) func() ([][]uuid.UUID, []error)
- func (l *UUIDsLoader) LoadThunk(key uuid.UUID) func() ([]uuid.UUID, error)
- func (l *UUIDsLoader) Prime(key uuid.UUID, value []uuid.UUID) bool
- type UUIDsLoaderConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLoadersKey ¶
func GetLoadersKey() contextKey
Types ¶
type BodyModificationsLoader ¶
type BodyModificationsLoader struct {
// contains filtered or unexported fields
}
BodyModificationsLoader batches and caches requests
func NewBodyModificationsLoader ¶
func NewBodyModificationsLoader(config BodyModificationsLoaderConfig) *BodyModificationsLoader
NewBodyModificationsLoader creates a new BodyModificationsLoader given a fetch, wait, and maxBatch
func (*BodyModificationsLoader) Clear ¶
func (l *BodyModificationsLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*BodyModificationsLoader) Load ¶
func (l *BodyModificationsLoader) Load(key uuid.UUID) ([]*models.BodyModification, error)
Load a BodyModification by key, batching and caching will be applied automatically
func (*BodyModificationsLoader) LoadAll ¶
func (l *BodyModificationsLoader) LoadAll(keys []uuid.UUID) ([][]*models.BodyModification, []error)
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*BodyModificationsLoader) LoadAllThunk ¶
func (l *BodyModificationsLoader) LoadAllThunk(keys []uuid.UUID) func() ([][]*models.BodyModification, []error)
LoadAllThunk returns a function that when called will block waiting for a BodyModifications. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*BodyModificationsLoader) LoadThunk ¶
func (l *BodyModificationsLoader) LoadThunk(key uuid.UUID) func() ([]*models.BodyModification, error)
LoadThunk returns a function that when called will block waiting for a BodyModification. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*BodyModificationsLoader) Prime ¶
func (l *BodyModificationsLoader) Prime(key uuid.UUID, value []*models.BodyModification) bool
Prime the cache with the provided key and value. If the key already exists, no change is made and false is returned. (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).)
type BodyModificationsLoaderConfig ¶
type BodyModificationsLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([][]*models.BodyModification, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
BodyModificationsLoaderConfig captures the config to create a new BodyModificationsLoader
type BoolsLoader ¶ added in v0.5.1
type BoolsLoader struct {
// contains filtered or unexported fields
}
BoolsLoader batches and caches requests
func NewBoolsLoader ¶ added in v0.5.1
func NewBoolsLoader(config BoolsLoaderConfig) *BoolsLoader
NewBoolsLoader creates a new BoolsLoader given a fetch, wait, and maxBatch
func (*BoolsLoader) Clear ¶ added in v0.5.1
func (l *BoolsLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*BoolsLoader) Load ¶ added in v0.5.1
func (l *BoolsLoader) Load(key uuid.UUID) (bool, error)
Load a bool by key, batching and caching will be applied automatically
func (*BoolsLoader) LoadAll ¶ added in v0.5.1
func (l *BoolsLoader) LoadAll(keys []uuid.UUID) ([]bool, []error)
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*BoolsLoader) LoadAllThunk ¶ added in v0.5.1
func (l *BoolsLoader) LoadAllThunk(keys []uuid.UUID) func() ([]bool, []error)
LoadAllThunk returns a function that when called will block waiting for a bools. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*BoolsLoader) LoadThunk ¶ added in v0.5.1
func (l *BoolsLoader) LoadThunk(key uuid.UUID) func() (bool, error)
LoadThunk returns a function that when called will block waiting for a bool. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*BoolsLoader) Prime ¶ added in v0.5.1
func (l *BoolsLoader) Prime(key uuid.UUID, value bool) bool
Prime the cache with the provided key and value. If the key already exists, no change is made and false is returned. (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).)
type BoolsLoaderConfig ¶ added in v0.5.1
type BoolsLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([]bool, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
BoolsLoaderConfig captures the config to create a new BoolsLoader
type EditCommentLoader ¶ added in v0.6.0
type EditCommentLoader struct {
// contains filtered or unexported fields
}
EditCommentLoader batches and caches requests
func NewEditCommentLoader ¶ added in v0.6.0
func NewEditCommentLoader(config EditCommentLoaderConfig) *EditCommentLoader
NewEditCommentLoader creates a new EditCommentLoader given a fetch, wait, and maxBatch
func (*EditCommentLoader) Clear ¶ added in v0.6.0
func (l *EditCommentLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*EditCommentLoader) Load ¶ added in v0.6.0
func (l *EditCommentLoader) Load(key uuid.UUID) (*models.EditComment, error)
Load a EditComment by key, batching and caching will be applied automatically
func (*EditCommentLoader) LoadAll ¶ added in v0.6.0
func (l *EditCommentLoader) LoadAll(keys []uuid.UUID) ([]*models.EditComment, []error)
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*EditCommentLoader) LoadAllThunk ¶ added in v0.6.0
func (l *EditCommentLoader) LoadAllThunk(keys []uuid.UUID) func() ([]*models.EditComment, []error)
LoadAllThunk returns a function that when called will block waiting for a EditComments. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*EditCommentLoader) LoadThunk ¶ added in v0.6.0
func (l *EditCommentLoader) LoadThunk(key uuid.UUID) func() (*models.EditComment, error)
LoadThunk returns a function that when called will block waiting for a EditComment. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*EditCommentLoader) Prime ¶ added in v0.6.0
func (l *EditCommentLoader) Prime(key uuid.UUID, value *models.EditComment) bool
Prime the cache with the provided key and value. If the key already exists, no change is made and false is returned. (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).)
type EditCommentLoaderConfig ¶ added in v0.6.0
type EditCommentLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([]*models.EditComment, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
EditCommentLoaderConfig captures the config to create a new EditCommentLoader
type EditLoader ¶ added in v0.6.0
type EditLoader struct {
// contains filtered or unexported fields
}
EditLoader batches and caches requests
func NewEditLoader ¶ added in v0.6.0
func NewEditLoader(config EditLoaderConfig) *EditLoader
NewEditLoader creates a new EditLoader given a fetch, wait, and maxBatch
func (*EditLoader) Clear ¶ added in v0.6.0
func (l *EditLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*EditLoader) Load ¶ added in v0.6.0
Load a Edit by key, batching and caching will be applied automatically
func (*EditLoader) LoadAll ¶ added in v0.6.0
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*EditLoader) LoadAllThunk ¶ added in v0.6.0
LoadAllThunk returns a function that when called will block waiting for a Edits. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*EditLoader) LoadThunk ¶ added in v0.6.0
LoadThunk returns a function that when called will block waiting for a Edit. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
type EditLoaderConfig ¶ added in v0.6.0
type EditLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([]*models.Edit, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
EditLoaderConfig captures the config to create a new EditLoader
type FingerprintsLoader ¶
type FingerprintsLoader struct {
// contains filtered or unexported fields
}
FingerprintsLoader batches and caches requests
func NewFingerprintsLoader ¶
func NewFingerprintsLoader(config FingerprintsLoaderConfig) *FingerprintsLoader
NewFingerprintsLoader creates a new FingerprintsLoader given a fetch, wait, and maxBatch
func (*FingerprintsLoader) Clear ¶
func (l *FingerprintsLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*FingerprintsLoader) Load ¶
func (l *FingerprintsLoader) Load(key uuid.UUID) ([]*models.Fingerprint, error)
Load a Fingerprint by key, batching and caching will be applied automatically
func (*FingerprintsLoader) LoadAll ¶
func (l *FingerprintsLoader) LoadAll(keys []uuid.UUID) ([][]*models.Fingerprint, []error)
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*FingerprintsLoader) LoadAllThunk ¶
func (l *FingerprintsLoader) LoadAllThunk(keys []uuid.UUID) func() ([][]*models.Fingerprint, []error)
LoadAllThunk returns a function that when called will block waiting for a Fingerprints. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*FingerprintsLoader) LoadThunk ¶
func (l *FingerprintsLoader) LoadThunk(key uuid.UUID) func() ([]*models.Fingerprint, error)
LoadThunk returns a function that when called will block waiting for a Fingerprint. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*FingerprintsLoader) Prime ¶
func (l *FingerprintsLoader) Prime(key uuid.UUID, value []*models.Fingerprint) bool
Prime the cache with the provided key and value. If the key already exists, no change is made and false is returned. (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).)
type FingerprintsLoaderConfig ¶
type FingerprintsLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([][]*models.Fingerprint, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
FingerprintsLoaderConfig captures the config to create a new FingerprintsLoader
type ImageLoader ¶
type ImageLoader struct {
// contains filtered or unexported fields
}
ImageLoader batches and caches requests
func NewImageLoader ¶
func NewImageLoader(config ImageLoaderConfig) *ImageLoader
NewImageLoader creates a new ImageLoader given a fetch, wait, and maxBatch
func (*ImageLoader) Clear ¶
func (l *ImageLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*ImageLoader) LoadAll ¶
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*ImageLoader) LoadAllThunk ¶
LoadAllThunk returns a function that when called will block waiting for a Images. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*ImageLoader) LoadThunk ¶
LoadThunk returns a function that when called will block waiting for a Image. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
type ImageLoaderConfig ¶
type ImageLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([]*models.Image, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
ImageLoaderConfig captures the config to create a new ImageLoader
type Loaders ¶
type Loaders struct { SceneFingerprintsByID FingerprintsLoader SubmittedSceneFingerprintsByID FingerprintsLoader ImageByID ImageLoader PerformerByID PerformerLoader PerformerAliasesByID StringsLoader PerformerImageIDsByID UUIDsLoader PerformerMergeIDsByID UUIDsLoader PerformerMergeIDsBySourceID UUIDsLoader PerformerPiercingsByID BodyModificationsLoader PerformerTattoosByID BodyModificationsLoader PerformerUrlsByID URLLoader PerformerIsFavoriteByID BoolsLoader SceneByID SceneLoader SceneImageIDsByID UUIDsLoader SceneAppearancesByID SceneAppearancesLoader SceneUrlsByID URLLoader StudioImageIDsByID UUIDsLoader StudioIsFavoriteByID BoolsLoader StudioUrlsByID URLLoader StudioAliasesByID StringsLoader SceneTagIDsByID UUIDsLoader SiteByID SiteLoader StudioByID StudioLoader TagByID TagLoader TagCategoryByID TagCategoryLoader EditByID EditLoader EditCommentByID EditCommentLoader }
type PerformerLoader ¶
type PerformerLoader struct {
// contains filtered or unexported fields
}
PerformerLoader batches and caches requests
func NewPerformerLoader ¶
func NewPerformerLoader(config PerformerLoaderConfig) *PerformerLoader
NewPerformerLoader creates a new PerformerLoader given a fetch, wait, and maxBatch
func (*PerformerLoader) Clear ¶
func (l *PerformerLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*PerformerLoader) Load ¶
Load a Performer by key, batching and caching will be applied automatically
func (*PerformerLoader) LoadAll ¶
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*PerformerLoader) LoadAllThunk ¶
LoadAllThunk returns a function that when called will block waiting for a Performers. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*PerformerLoader) LoadThunk ¶
LoadThunk returns a function that when called will block waiting for a Performer. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
type PerformerLoaderConfig ¶
type PerformerLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([]*models.Performer, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
PerformerLoaderConfig captures the config to create a new PerformerLoader
type SceneAppearancesLoader ¶
type SceneAppearancesLoader struct {
// contains filtered or unexported fields
}
SceneAppearancesLoader batches and caches requests
func NewSceneAppearancesLoader ¶
func NewSceneAppearancesLoader(config SceneAppearancesLoaderConfig) *SceneAppearancesLoader
NewSceneAppearancesLoader creates a new SceneAppearancesLoader given a fetch, wait, and maxBatch
func (*SceneAppearancesLoader) Clear ¶
func (l *SceneAppearancesLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*SceneAppearancesLoader) Load ¶
func (l *SceneAppearancesLoader) Load(key uuid.UUID) (models.PerformersScenes, error)
Load a PerformersScenes by key, batching and caching will be applied automatically
func (*SceneAppearancesLoader) LoadAll ¶
func (l *SceneAppearancesLoader) LoadAll(keys []uuid.UUID) ([]models.PerformersScenes, []error)
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*SceneAppearancesLoader) LoadAllThunk ¶
func (l *SceneAppearancesLoader) LoadAllThunk(keys []uuid.UUID) func() ([]models.PerformersScenes, []error)
LoadAllThunk returns a function that when called will block waiting for a PerformersSceness. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*SceneAppearancesLoader) LoadThunk ¶
func (l *SceneAppearancesLoader) LoadThunk(key uuid.UUID) func() (models.PerformersScenes, error)
LoadThunk returns a function that when called will block waiting for a PerformersScenes. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*SceneAppearancesLoader) Prime ¶
func (l *SceneAppearancesLoader) Prime(key uuid.UUID, value models.PerformersScenes) bool
Prime the cache with the provided key and value. If the key already exists, no change is made and false is returned. (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).)
type SceneAppearancesLoaderConfig ¶
type SceneAppearancesLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([]models.PerformersScenes, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
SceneAppearancesLoaderConfig captures the config to create a new SceneAppearancesLoader
type SceneLoader ¶ added in v0.6.0
type SceneLoader struct {
// contains filtered or unexported fields
}
SceneLoader batches and caches requests
func NewSceneLoader ¶ added in v0.6.0
func NewSceneLoader(config SceneLoaderConfig) *SceneLoader
NewSceneLoader creates a new SceneLoader given a fetch, wait, and maxBatch
func (*SceneLoader) Clear ¶ added in v0.6.0
func (l *SceneLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*SceneLoader) Load ¶ added in v0.6.0
Load a Scene by key, batching and caching will be applied automatically
func (*SceneLoader) LoadAll ¶ added in v0.6.0
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*SceneLoader) LoadAllThunk ¶ added in v0.6.0
LoadAllThunk returns a function that when called will block waiting for a Scenes. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*SceneLoader) LoadThunk ¶ added in v0.6.0
LoadThunk returns a function that when called will block waiting for a Scene. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
type SceneLoaderConfig ¶ added in v0.6.0
type SceneLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([]*models.Scene, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
SceneLoaderConfig captures the config to create a new SceneLoader
type SiteLoader ¶ added in v0.1.0
type SiteLoader struct {
// contains filtered or unexported fields
}
SiteLoader batches and caches requests
func NewSiteLoader ¶ added in v0.1.0
func NewSiteLoader(config SiteLoaderConfig) *SiteLoader
NewSiteLoader creates a new SiteLoader given a fetch, wait, and maxBatch
func (*SiteLoader) Clear ¶ added in v0.1.0
func (l *SiteLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*SiteLoader) Load ¶ added in v0.1.0
Load a Site by key, batching and caching will be applied automatically
func (*SiteLoader) LoadAll ¶ added in v0.1.0
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*SiteLoader) LoadAllThunk ¶ added in v0.1.0
LoadAllThunk returns a function that when called will block waiting for a Sites. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*SiteLoader) LoadThunk ¶ added in v0.1.0
LoadThunk returns a function that when called will block waiting for a Site. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
type SiteLoaderConfig ¶ added in v0.1.0
type SiteLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([]*models.Site, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
SiteLoaderConfig captures the config to create a new SiteLoader
type StringsLoader ¶
type StringsLoader struct {
// contains filtered or unexported fields
}
StringsLoader batches and caches requests
func NewStringsLoader ¶
func NewStringsLoader(config StringsLoaderConfig) *StringsLoader
NewStringsLoader creates a new StringsLoader given a fetch, wait, and maxBatch
func (*StringsLoader) Clear ¶
func (l *StringsLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*StringsLoader) Load ¶
func (l *StringsLoader) Load(key uuid.UUID) ([]string, error)
Load a string by key, batching and caching will be applied automatically
func (*StringsLoader) LoadAll ¶
func (l *StringsLoader) LoadAll(keys []uuid.UUID) ([][]string, []error)
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*StringsLoader) LoadAllThunk ¶
func (l *StringsLoader) LoadAllThunk(keys []uuid.UUID) func() ([][]string, []error)
LoadAllThunk returns a function that when called will block waiting for a strings. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*StringsLoader) LoadThunk ¶
func (l *StringsLoader) LoadThunk(key uuid.UUID) func() ([]string, error)
LoadThunk returns a function that when called will block waiting for a string. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*StringsLoader) Prime ¶
func (l *StringsLoader) Prime(key uuid.UUID, value []string) bool
Prime the cache with the provided key and value. If the key already exists, no change is made and false is returned. (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).)
type StringsLoaderConfig ¶
type StringsLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([][]string, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
StringsLoaderConfig captures the config to create a new StringsLoader
type StudioLoader ¶ added in v0.4.0
type StudioLoader struct {
// contains filtered or unexported fields
}
StudioLoader batches and caches requests
func NewStudioLoader ¶ added in v0.4.0
func NewStudioLoader(config StudioLoaderConfig) *StudioLoader
NewStudioLoader creates a new StudioLoader given a fetch, wait, and maxBatch
func (*StudioLoader) Clear ¶ added in v0.4.0
func (l *StudioLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*StudioLoader) Load ¶ added in v0.4.0
Load a Studio by key, batching and caching will be applied automatically
func (*StudioLoader) LoadAll ¶ added in v0.4.0
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*StudioLoader) LoadAllThunk ¶ added in v0.4.0
LoadAllThunk returns a function that when called will block waiting for a Studios. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*StudioLoader) LoadThunk ¶ added in v0.4.0
LoadThunk returns a function that when called will block waiting for a Studio. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
type StudioLoaderConfig ¶ added in v0.4.0
type StudioLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([]*models.Studio, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
StudioLoaderConfig captures the config to create a new StudioLoader
type SubmittedFingerprintsLoader ¶ added in v0.4.0
type SubmittedFingerprintsLoader struct {
// contains filtered or unexported fields
}
SubmittedFingerprintsLoader batches and caches requests
func NewSubmittedFingerprintsLoader ¶ added in v0.4.0
func NewSubmittedFingerprintsLoader(config SubmittedFingerprintsLoaderConfig) *SubmittedFingerprintsLoader
NewSubmittedFingerprintsLoader creates a new SubmittedFingerprintsLoader given a fetch, wait, and maxBatch
func (*SubmittedFingerprintsLoader) Clear ¶ added in v0.4.0
func (l *SubmittedFingerprintsLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*SubmittedFingerprintsLoader) Load ¶ added in v0.4.0
func (l *SubmittedFingerprintsLoader) Load(key uuid.UUID) ([]*models.Fingerprint, error)
Load a Fingerprint by key, batching and caching will be applied automatically
func (*SubmittedFingerprintsLoader) LoadAll ¶ added in v0.4.0
func (l *SubmittedFingerprintsLoader) LoadAll(keys []uuid.UUID) ([][]*models.Fingerprint, []error)
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*SubmittedFingerprintsLoader) LoadAllThunk ¶ added in v0.4.0
func (l *SubmittedFingerprintsLoader) LoadAllThunk(keys []uuid.UUID) func() ([][]*models.Fingerprint, []error)
LoadAllThunk returns a function that when called will block waiting for a Fingerprints. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*SubmittedFingerprintsLoader) LoadThunk ¶ added in v0.4.0
func (l *SubmittedFingerprintsLoader) LoadThunk(key uuid.UUID) func() ([]*models.Fingerprint, error)
LoadThunk returns a function that when called will block waiting for a Fingerprint. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*SubmittedFingerprintsLoader) Prime ¶ added in v0.4.0
func (l *SubmittedFingerprintsLoader) Prime(key uuid.UUID, value []*models.Fingerprint) bool
Prime the cache with the provided key and value. If the key already exists, no change is made and false is returned. (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).)
type SubmittedFingerprintsLoaderConfig ¶ added in v0.4.0
type SubmittedFingerprintsLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([][]*models.Fingerprint, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
SubmittedFingerprintsLoaderConfig captures the config to create a new SubmittedFingerprintsLoader
type TagCategoryLoader ¶
type TagCategoryLoader struct {
// contains filtered or unexported fields
}
TagCategoryLoader batches and caches requests
func NewTagCategoryLoader ¶
func NewTagCategoryLoader(config TagCategoryLoaderConfig) *TagCategoryLoader
NewTagCategoryLoader creates a new TagCategoryLoader given a fetch, wait, and maxBatch
func (*TagCategoryLoader) Clear ¶
func (l *TagCategoryLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*TagCategoryLoader) Load ¶
func (l *TagCategoryLoader) Load(key uuid.UUID) (*models.TagCategory, error)
Load a TagCategory by key, batching and caching will be applied automatically
func (*TagCategoryLoader) LoadAll ¶
func (l *TagCategoryLoader) LoadAll(keys []uuid.UUID) ([]*models.TagCategory, []error)
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*TagCategoryLoader) LoadAllThunk ¶
func (l *TagCategoryLoader) LoadAllThunk(keys []uuid.UUID) func() ([]*models.TagCategory, []error)
LoadAllThunk returns a function that when called will block waiting for a TagCategorys. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*TagCategoryLoader) LoadThunk ¶
func (l *TagCategoryLoader) LoadThunk(key uuid.UUID) func() (*models.TagCategory, error)
LoadThunk returns a function that when called will block waiting for a TagCategory. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*TagCategoryLoader) Prime ¶
func (l *TagCategoryLoader) Prime(key uuid.UUID, value *models.TagCategory) bool
Prime the cache with the provided key and value. If the key already exists, no change is made and false is returned. (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).)
type TagCategoryLoaderConfig ¶
type TagCategoryLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([]*models.TagCategory, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
TagCategoryLoaderConfig captures the config to create a new TagCategoryLoader
type TagLoader ¶
type TagLoader struct {
// contains filtered or unexported fields
}
TagLoader batches and caches requests
func NewTagLoader ¶
func NewTagLoader(config TagLoaderConfig) *TagLoader
NewTagLoader creates a new TagLoader given a fetch, wait, and maxBatch
func (*TagLoader) LoadAll ¶
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*TagLoader) LoadAllThunk ¶
LoadAllThunk returns a function that when called will block waiting for a Tags. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*TagLoader) LoadThunk ¶
LoadThunk returns a function that when called will block waiting for a Tag. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
type TagLoaderConfig ¶
type TagLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([]*models.Tag, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
TagLoaderConfig captures the config to create a new TagLoader
type URLLoader ¶
type URLLoader struct {
// contains filtered or unexported fields
}
URLLoader batches and caches requests
func NewURLLoader ¶
func NewURLLoader(config URLLoaderConfig) *URLLoader
NewURLLoader creates a new URLLoader given a fetch, wait, and maxBatch
func (*URLLoader) LoadAll ¶
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*URLLoader) LoadAllThunk ¶
LoadAllThunk returns a function that when called will block waiting for a URLs. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*URLLoader) LoadThunk ¶
LoadThunk returns a function that when called will block waiting for a URL. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
type URLLoaderConfig ¶
type URLLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([][]*models.URL, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
URLLoaderConfig captures the config to create a new URLLoader
type UUIDsLoader ¶
type UUIDsLoader struct {
// contains filtered or unexported fields
}
UUIDsLoader batches and caches requests
func NewUUIDsLoader ¶
func NewUUIDsLoader(config UUIDsLoaderConfig) *UUIDsLoader
NewUUIDsLoader creates a new UUIDsLoader given a fetch, wait, and maxBatch
func (*UUIDsLoader) Clear ¶
func (l *UUIDsLoader) Clear(key uuid.UUID)
Clear the value at key from the cache, if it exists
func (*UUIDsLoader) LoadAll ¶
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*UUIDsLoader) LoadAllThunk ¶
LoadAllThunk returns a function that when called will block waiting for a UUIDs. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
func (*UUIDsLoader) LoadThunk ¶
LoadThunk returns a function that when called will block waiting for a UUID. This method should be used if you want one goroutine to make requests to many different data loaders without blocking until the thunk is called.
type UUIDsLoaderConfig ¶
type UUIDsLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []uuid.UUID) ([][]uuid.UUID, []error) // Wait is how long wait before sending a batch Wait time.Duration // MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit MaxBatch int }
UUIDsLoaderConfig captures the config to create a new UUIDsLoader
Source Files
¶
- bodymodificationsloader_gen.go
- boolsloader_gen.go
- editcommentloader_gen.go
- editloader_gen.go
- fingerprintsloader_gen.go
- imageloader_gen.go
- loaders.go
- performerloader_gen.go
- sceneappearancesloader_gen.go
- sceneloader_gen.go
- siteloader_gen.go
- stringsloader_gen.go
- studioloader_gen.go
- submittedfingerprintsloader_gen.go
- tagcategoryloader_gen.go
- tagloader_gen.go
- urlloader_gen.go
- uuidsloader_gen.go