engine

package
v0.7.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2023 License: Apache-2.0, MIT Imports: 20 Imported by: 1

Documentation

Index

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

func New(resultCache cache.Interface, valueStore indexer.Interface, options ...Option) *Engine

New implements the indexer.Interface. It creates a new Engine with the given result cache and value store.

func (*Engine) Close

func (e *Engine) Close() error

func (*Engine) Flush

func (e *Engine) Flush() error

func (*Engine) Get

func (e *Engine) Get(m multihash.Multihash) ([]indexer.Value, bool, error)

func (*Engine) Iter

func (e *Engine) Iter() (indexer.Iterator, error)

func (*Engine) Put

func (e *Engine) Put(value indexer.Value, mhs ...multihash.Multihash) error

func (*Engine) Remove

func (e *Engine) Remove(value indexer.Value, mhs ...multihash.Multihash) error

func (*Engine) RemoveProvider

func (e *Engine) RemoveProvider(ctx context.Context, providerID peer.ID) error

func (*Engine) RemoveProviderContext

func (e *Engine) RemoveProviderContext(providerID peer.ID, contextID []byte) error

func (*Engine) Size

func (e *Engine) Size() (int64, error)

func (*Engine) Stats

func (e *Engine) Stats() (*indexer.Stats, error)

type Option

type Option func(*config) error

func WithCacheOnPut

func WithCacheOnPut(on bool) Option

WithCacheOnPut sets whether or not entries are cached on Put.

func WithDHBatchSize

func WithDHBatchSize(size int) Option

WithDHBatchSize configures the batch size when sending batches of merge requests to DHStore. A value < 1 results in the default size.

func WithDHStore

func WithDHStore(dhsURL string) Option

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

func WithDHStoreCluster(clusterUrls []string) Option

WithDHStoreCluster provide addional URLs that the core will send delete requests to. Deletes are 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 must not be included in this list.

func WithHttpClientTimeout added in v0.7.1

func WithHttpClientTimeout(timeout time.Duration) Option

WithHttpClientTimeout sets http timeout for queries to DHStore

func WithVSNoNewMH

func WithVSNoNewMH(ok bool) Option

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL