search

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterOpts

type FilterOpts struct {
	Categories  []string
	Keywords    []string
	SearchDepth int
}

FilterOpts is used to configure an advanced search

type Searcher

type Searcher interface {
	// Close shuts down the service datastore
	Close() error
	// GetEntries is used to get all known entries
	GetEntries() ([]query.Entry, error)
	// MigrateEntries is used to migrate entries to newer object types
	MigrateEntries(entries []query.Entry, im *rtfs.IpfsManager, migrateContent bool) error
	// Put is used to store something in badgerds
	Put(keyName string, data []byte) error
	// Get is used to retrieve something from badgerds by key name
	Get(keyName string) ([]byte, error)
	// Has is used to check if our database has a key matching this name
	Has(keyName string) (bool, error)
	// KeywordSearch retrieves a slice of content hashes that were indexed with these keywords
	KeywordSearch(keywords []string) ([]models.Object, error)
	// AdvancedSearch is used to perform an advanced search against the lens index
	AdvancedSearch(opts *FilterOpts) ([]models.Object, error)
}

Searcher provides the internal Lens search API

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is our searcher service

func NewService

func NewService(dsPath string) (*Service, error)

NewService is used to generate our new searcher service

func (*Service) AdvancedSearch

func (s *Service) AdvancedSearch(opts *FilterOpts) ([]models.Object, error)

AdvancedSearch is used to perform an advanced search against the lens index

func (*Service) Close

func (s *Service) Close() error

Close shuts down the service datastore

func (*Service) Get

func (s *Service) Get(keyName string) ([]byte, error)

Get is used to retrieve something from badgerds by key name

func (*Service) GetEntries

func (s *Service) GetEntries() ([]query.Entry, error)

GetEntries is used to get all known entries

func (*Service) Has

func (s *Service) Has(keyName string) (bool, error)

Has is used to check if our database has a key matching this name

func (*Service) KeywordSearch

func (s *Service) KeywordSearch(keywords []string) ([]models.Object, error)

KeywordSearch retrieves a slice of content hashes that were indexed with these keywords

func (*Service) MigrateEntries

func (s *Service) MigrateEntries(entries []query.Entry, im *rtfs.IpfsManager, migrateContent bool) error

MigrateEntries is used to migrate entries to newer object types

func (*Service) Put

func (s *Service) Put(keyName string, data []byte) error

Put is used to store something in badgerds

Jump to

Keyboard shortcuts

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