Documentation ¶
Index ¶
- func AddProviderNotSupported(backend providers.ProviderStore) providers.ProviderStore
- func CombineProviders(backend ...providers.ProviderStore) providers.ProviderStore
- func NewAsyncProvidersFinder(timeout time.Duration, queueSize int, negativeCacheTTL time.Duration) *asyncProvidersFinder
- func NewDynamoDBProviderStore(self peer.ID, peerstore peerStore, ddbClient ddbClient, tableName string, ...) *dynamoDBProviderStore
- func NewReframeProviderStore(httpClient *http.Client, endpointURL string) (*reframeProvider, error)
- type AddProviderNotSupportedProviderStore
- type CachingProviderStore
- type CombinedProviderStore
- type ProvidersFinder
- type ReadContentRouting
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddProviderNotSupported ¶
func AddProviderNotSupported(backend providers.ProviderStore) providers.ProviderStore
func CombineProviders ¶
func CombineProviders(backend ...providers.ProviderStore) providers.ProviderStore
func NewAsyncProvidersFinder ¶
Types ¶
type AddProviderNotSupportedProviderStore ¶
type AddProviderNotSupportedProviderStore struct {
// contains filtered or unexported fields
}
func (*AddProviderNotSupportedProviderStore) AddProvider ¶
func (*AddProviderNotSupportedProviderStore) GetProviders ¶
type CachingProviderStore ¶
type CachingProviderStore struct { ReadProviderStore providers.ProviderStore WriteProviderStore providers.ProviderStore Finder ProvidersFinder Router ReadContentRouting // contains filtered or unexported fields }
CachingProviderStore checks the ReadProviderStore for providers. If no providers are returned, then the Finder is used to find providers, which are then added to the WriteProviderStore.
func NewCachingProviderStore ¶
func NewCachingProviderStore(getDelegate providers.ProviderStore, addDelegate providers.ProviderStore, finder ProvidersFinder, router ReadContentRouting) *CachingProviderStore
func (*CachingProviderStore) AddProvider ¶
func (*CachingProviderStore) GetProviders ¶
func (d *CachingProviderStore) GetProviders(ctx context.Context, key []byte) ([]peer.AddrInfo, error)
GetProviders gets providers for the given key from the providerstore. If the providerstore does not have providers for the key, then the ProvidersFinder is queried and the results are cached.
type CombinedProviderStore ¶
type CombinedProviderStore struct {
// contains filtered or unexported fields
}
func (*CombinedProviderStore) AddProvider ¶
func (*CombinedProviderStore) GetProviders ¶
type ProvidersFinder ¶
type ProvidersFinder interface {
Find(ctx context.Context, router ReadContentRouting, key []byte, onProvider onProviderFunc) error
}
ProvidersFinder finds providers for the given key using the given content router, passing each to the callback.
Click to show internal directories.
Click to hide internal directories.