engine

package
v0.8.10 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0, MIT Imports: 10 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 value store and an optional result cache.

func New

func New(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 WithCache added in v0.8.0

func WithCache(cache cache.Interface) Option

WithCache provides a the engine with an index result cache.

func WithCacheOnPut

func WithCacheOnPut(on bool) Option

WithCacheOnPut sets whether or not entries are cached on Put.

Jump to

Keyboard shortcuts

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