Documentation ¶
Index ¶
- type Engine
- func (e *Engine) Close() error
- func (e *Engine) Flush() error
- func (e *Engine) Get(m multihash.Multihash) ([]indexer.Value, bool, error)
- func (e *Engine) Iter() (indexer.Iterator, error)
- func (e *Engine) Put(value indexer.Value, mhs ...multihash.Multihash) error
- func (e *Engine) Remove(value indexer.Value, mhs ...multihash.Multihash) error
- func (e *Engine) RemoveProvider(ctx context.Context, providerID peer.ID) error
- func (e *Engine) RemoveProviderContext(providerID peer.ID, contextID []byte) error
- func (e *Engine) Size() (int64, error)
- func (e *Engine) Stats() (*indexer.Stats, error)
- type Option
- func WithCacheOnPut(on bool) Option
- func WithDHBatchSize(size int) Option
- func WithDHKeyShard(enabled bool) Option
- func WithDHShardConcurrency(n int) Option
- func WithDHStore(dhsURL string) Option
- func WithDHStoreCluster(clusterUrls []string) Option
- func WithHttpClientTimeout(timeout time.Duration) Option
- func WithVSNoNewMH(ok bool) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is an implementation of indexer.Interface that combines a result cache and a value store.
func New ¶
New implements the indexer.Interface. It creates a new Engine with the given result cache and value store.
func (*Engine) RemoveProvider ¶
func (*Engine) RemoveProviderContext ¶
type Option ¶
type Option func(*config) error
func WithCacheOnPut ¶
WithCacheOnPut sets whether or not entries are cached on Put.
func WithDHBatchSize ¶
WithDHBatchSize configures the batch size when sending batches of merge requests to DHStore. A value < 1 results in the default size.
func WithDHKeyShard ¶ added in v0.7.8
WithDHKeyShard enables/disabled the dhstore key sharding for the core. When key sharding is enabled (on by default), a shard key is included with each metadata put request, and a seperate merge request with a shard key is sent for each multihash. Context delete requests are also sent with a shard key.
func WithDHShardConcurrency ¶ added in v0.7.8
func WithDHStore ¶
WithDHStore sets the base URL for the dhstore service, and tells the core to send its values to the dhstore.
func WithDHStoreCluster ¶ added in v0.7.7
WithDHStoreCluster provide addional URLs that the core will send delete requests to. Deletes will be send to the dhstoreURL as well as to all dhstoreClusterURLs. This is required as deletes need to be applied to all nodes until consistent hashing is implemented. dhstoreURL shouldn't be included in this list.
func WithHttpClientTimeout ¶ added in v0.7.1
WithHttpClientTimeout sets http timeout for queries to DHStore
func WithVSNoNewMH ¶
WithVSNoNewMH blocks putting new multihashes into the value store when set to true. New indexes will still be send to the DHStore service if one is configured.