search

package
v5.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: BSD-3-Clause, BSD-3-Clause, BSD-3-Clause Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, kbCtx libkbfs.Context, params libkbfs.InitParams,
	keybaseServiceCn libkbfs.KeybaseServiceCn,
	log logger.Logger, vlogLevel string) (
	context.Context, libkbfs.Config, error)

Init initializes a context and a libkbfs.Config for search operations. The config should be shutdown when it is done being used.

func Params

func Params(kbCtx libkbfs.Context, storageRoot string, uid keybase1.UID) (
	params libkbfs.InitParams, err error)

Params returns a set of default parameters for search-related operations.

Types

type DbClosedError

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

DbClosedError indicates that the DB has been closed, and thus isn't accepting any more operations.

func (DbClosedError) Error

func (e DbClosedError) Error() string

Error implements the error interface for DbClosedError.

type DocDb

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

DocDb is a database that holds metadata about indexed documents.

func (*DocDb) Delete

func (db *DocDb) Delete(
	ctx context.Context, docID string) error

Delete removes the metadata for the TLF from the DB.

func (*DocDb) Get

func (db *DocDb) Get(ctx context.Context, docID string) (
	parentDocID, name string, err error)

Get returns the info for the given doc.

func (*DocDb) Put

func (db *DocDb) Put(
	ctx context.Context, docID, parentDocID, name string) error

Put saves the revisions for the given TLF.

func (*DocDb) Shutdown

func (db *DocDb) Shutdown(ctx context.Context)

Shutdown closes this db.

type IndexedBlockDb

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

IndexedBlockDb is a database that holds metadata about indexed blocks.

func (*IndexedBlockDb) Delete

func (db *IndexedBlockDb) Delete(
	ctx context.Context, tlfID tlf.ID, ptr data.BlockPointer) error

Delete removes the metadata for the block pointer from the DB.

func (*IndexedBlockDb) Get

func (db *IndexedBlockDb) Get(
	ctx context.Context, ptr data.BlockPointer) (
	indexVersion uint, docID string, err error)

Get returns the version and doc ID for the given block.

func (*IndexedBlockDb) GetNextDocIDs

func (db *IndexedBlockDb) GetNextDocIDs(n int) ([]string, error)

GetNextDocIDs generates and reserves the next N doc IDs.

func (*IndexedBlockDb) Put

func (db *IndexedBlockDb) Put(
	ctx context.Context, tlfID tlf.ID, ptr data.BlockPointer, indexVersion uint,
	docID string) error

Put saves the version and doc ID for the given block.

func (*IndexedBlockDb) Shutdown

func (db *IndexedBlockDb) Shutdown(ctx context.Context)

Shutdown closes this db.

type IndexedTlfDb

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

IndexedTlfDb is a database that holds metadata about indexed TLFs.

func (*IndexedTlfDb) Delete

func (db *IndexedTlfDb) Delete(
	ctx context.Context, tlfID tlf.ID) error

Delete removes the metadata for the TLF from the DB.

func (*IndexedTlfDb) Get

func (db *IndexedTlfDb) Get(
	ctx context.Context, tlfID tlf.ID) (
	indexedRev, startedRev kbfsmd.Revision, err error)

Get returns the revisions for the given TLF.

func (*IndexedTlfDb) Put

func (db *IndexedTlfDb) Put(
	ctx context.Context, tlfID tlf.ID,
	indexedRev, startedRev kbfsmd.Revision) error

Put saves the revisions for the given TLF.

func (*IndexedTlfDb) Shutdown

func (db *IndexedTlfDb) Shutdown(ctx context.Context)

Shutdown closes this db.

type Indexer

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

Indexer can index and search KBFS TLFs.

func NewIndexer

func NewIndexer(config libkbfs.Config) (*Indexer, error)

NewIndexer creates a new instance of an Indexer.

func (*Indexer) FullSyncStarted

func (i *Indexer) FullSyncStarted(
	ctx context.Context, tlfID tlf.ID, rev kbfsmd.Revision,
	waitCh <-chan struct{})

FullSyncStarted implements the libkbfs.SyncedTlfObserver interface for Indexer.

func (*Indexer) Shutdown

func (i *Indexer) Shutdown(ctx context.Context) error

Shutdown shuts down this indexer.

func (*Indexer) SyncModeChanged

func (i *Indexer) SyncModeChanged(
	ctx context.Context, tlfID tlf.ID, newMode keybase1.FolderSyncMode)

SyncModeChanged implements the libkbfs.SyncedTlfObserver interface for Indexer.

func (*Indexer) UserChanged

func (i *Indexer) UserChanged(
	ctx context.Context, oldName, newName kbname.NormalizedUsername)

UserChanged implements the libfs.RemoteStatusUpdater for Indexer.

Jump to

Keyboard shortcuts

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