Documentation
¶
Index ¶
- Constants
- func AddToContext(ctx context.Context, exec boil.ContextExecutor, wait time.Duration) context.Context
- type OrganizationLoader
- func (l *OrganizationLoader) Clear(key string)
- func (l *OrganizationLoader) Load(key string) (*models.Organization, error)
- func (l *OrganizationLoader) LoadAll(keys []string) ([]*models.Organization, []error)
- func (l *OrganizationLoader) LoadAllThunk(keys []string) func() ([]*models.Organization, []error)
- func (l *OrganizationLoader) LoadThunk(key string) func() (*models.Organization, error)
- func (l *OrganizationLoader) Prime(key string, value *models.Organization) bool
- type OrganizationLoaderConfig
- type RepositoryLoader
- func (l *RepositoryLoader) Clear(key string)
- func (l *RepositoryLoader) Load(key string) (*models.Repository, error)
- func (l *RepositoryLoader) LoadAll(keys []string) ([]*models.Repository, []error)
- func (l *RepositoryLoader) LoadAllThunk(keys []string) func() ([]*models.Repository, []error)
- func (l *RepositoryLoader) LoadThunk(key string) func() (*models.Repository, error)
- func (l *RepositoryLoader) Prime(key string, value *models.Repository) bool
- type RepositoryLoaderConfig
- type TopicLoader
- func (l *TopicLoader) Clear(key string)
- func (l *TopicLoader) Load(key string) (*models.Topic, error)
- func (l *TopicLoader) LoadAll(keys []string) ([]*models.Topic, []error)
- func (l *TopicLoader) LoadAllThunk(keys []string) func() ([]*models.Topic, []error)
- func (l *TopicLoader) LoadThunk(key string) func() (*models.Topic, error)
- func (l *TopicLoader) Prime(key string, value *models.Topic) bool
- type TopicLoaderConfig
Constants ¶
const OrganizationLoaderKey = "organizationLoader"
OrganizationLoaderKey is the key under which the topic loader is stored in the session.
const RepositoryLoaderKey = "repositoryLoader"
RepositoryLoaderKey is the key under which the repository loader is stored in the session.
const TopicLoaderKey = "topicLoader"
TopicLoaderKey is the key under which the topic loader is stored in the session.
Variables ¶
This section is empty.
Functions ¶
func AddToContext ¶
Types ¶
type OrganizationLoader ¶
type OrganizationLoader struct {
// contains filtered or unexported fields
}
OrganizationLoader batches and caches requests
func NewOrganizationLoader ¶
func NewOrganizationLoader(config OrganizationLoaderConfig) *OrganizationLoader
NewOrganizationLoader creates a new OrganizationLoader given a fetch, wait, and maxBatch
func (*OrganizationLoader) Clear ¶
func (l *OrganizationLoader) Clear(key string)
Clear the value at key from the cache, if it exists
func (*OrganizationLoader) Load ¶
func (l *OrganizationLoader) Load(key string) (*models.Organization, error)
Load a Organization by key, batching and caching will be applied automatically
func (*OrganizationLoader) LoadAll ¶
func (l *OrganizationLoader) LoadAll(keys []string) ([]*models.Organization, []error)
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*OrganizationLoader) LoadAllThunk ¶
func (l *OrganizationLoader) LoadAllThunk(keys []string) func() ([]*models.Organization, []error)
LoadAllThunk returns a function that when called will block waiting for a Organizations. 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 (*OrganizationLoader) LoadThunk ¶
func (l *OrganizationLoader) LoadThunk(key string) func() (*models.Organization, error)
LoadThunk returns a function that when called will block waiting for a Organization. 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 (*OrganizationLoader) Prime ¶
func (l *OrganizationLoader) Prime(key string, value *models.Organization) 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 OrganizationLoaderConfig ¶
type OrganizationLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []string) ([]*models.Organization, []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 }
OrganizationLoaderConfig captures the config to create a new OrganizationLoader
type RepositoryLoader ¶
type RepositoryLoader struct {
// contains filtered or unexported fields
}
RepositoryLoader batches and caches requests
func NewRepositoryLoader ¶
func NewRepositoryLoader(config RepositoryLoaderConfig) *RepositoryLoader
NewRepositoryLoader creates a new RepositoryLoader given a fetch, wait, and maxBatch
func (*RepositoryLoader) Clear ¶
func (l *RepositoryLoader) Clear(key string)
Clear the value at key from the cache, if it exists
func (*RepositoryLoader) Load ¶
func (l *RepositoryLoader) Load(key string) (*models.Repository, error)
Load a Repository by key, batching and caching will be applied automatically
func (*RepositoryLoader) LoadAll ¶
func (l *RepositoryLoader) LoadAll(keys []string) ([]*models.Repository, []error)
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*RepositoryLoader) LoadAllThunk ¶
func (l *RepositoryLoader) LoadAllThunk(keys []string) func() ([]*models.Repository, []error)
LoadAllThunk returns a function that when called will block waiting for a Repositorys. 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 (*RepositoryLoader) LoadThunk ¶
func (l *RepositoryLoader) LoadThunk(key string) func() (*models.Repository, error)
LoadThunk returns a function that when called will block waiting for a Repository. 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 (*RepositoryLoader) Prime ¶
func (l *RepositoryLoader) Prime(key string, value *models.Repository) 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 RepositoryLoaderConfig ¶
type RepositoryLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []string) ([]*models.Repository, []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 }
RepositoryLoaderConfig captures the config to create a new RepositoryLoader
type TopicLoader ¶
type TopicLoader struct {
// contains filtered or unexported fields
}
TopicLoader batches and caches requests
func NewTopicLoader ¶
func NewTopicLoader(config TopicLoaderConfig) *TopicLoader
NewTopicLoader creates a new TopicLoader given a fetch, wait, and maxBatch
func (*TopicLoader) Clear ¶
func (l *TopicLoader) Clear(key string)
Clear the value at key from the cache, if it exists
func (*TopicLoader) Load ¶
func (l *TopicLoader) Load(key string) (*models.Topic, error)
Load a Topic by key, batching and caching will be applied automatically
func (*TopicLoader) LoadAll ¶
func (l *TopicLoader) LoadAll(keys []string) ([]*models.Topic, []error)
LoadAll fetches many keys at once. It will be broken into appropriate sized sub batches depending on how the loader is configured
func (*TopicLoader) LoadAllThunk ¶
func (l *TopicLoader) LoadAllThunk(keys []string) func() ([]*models.Topic, []error)
LoadAllThunk returns a function that when called will block waiting for a Topics. 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 (*TopicLoader) LoadThunk ¶
func (l *TopicLoader) LoadThunk(key string) func() (*models.Topic, error)
LoadThunk returns a function that when called will block waiting for a Topic. 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 (*TopicLoader) Prime ¶
func (l *TopicLoader) Prime(key string, value *models.Topic) 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 TopicLoaderConfig ¶
type TopicLoaderConfig struct { // Fetch is a method that provides the data for the loader Fetch func(keys []string) ([]*models.Topic, []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 }
TopicLoaderConfig captures the config to create a new TopicLoader