Documentation ¶
Index ¶
- func Init(ctx context.Context, kbCtx libkbfs.Context, params libkbfs.InitParams, ...) (context.Context, libkbfs.Config, error)
- func Params(kbCtx libkbfs.Context, storageRoot string, uid keybase1.UID) (params libkbfs.InitParams, err error)
- type DbClosedError
- type DocDb
- type IndexedBlockDb
- func (db *IndexedBlockDb) ClearMemory() error
- func (db *IndexedBlockDb) Delete(ctx context.Context, tlfID tlf.ID, ptr data.BlockPointer) error
- func (db *IndexedBlockDb) Get(ctx context.Context, ptr data.BlockPointer) (indexVersion uint64, docID string, dirDone bool, err error)
- func (db *IndexedBlockDb) GetNextDocIDs(n int) ([]string, error)
- func (db *IndexedBlockDb) Put(ctx context.Context, tlfID tlf.ID, ptr data.BlockPointer, indexVersion uint64, ...) error
- func (db *IndexedBlockDb) PutMemory(ctx context.Context, tlfID tlf.ID, ptr data.BlockPointer, indexVersion uint64, ...) (flushFn func() error, err error)
- func (db *IndexedBlockDb) Shutdown(ctx context.Context)
- type IndexedTlfDb
- func (db *IndexedTlfDb) Delete(ctx context.Context, tlfID tlf.ID) error
- func (db *IndexedTlfDb) Get(ctx context.Context, tlfID tlf.ID) (indexedRev, startedRev kbfsmd.Revision, err error)
- func (db *IndexedTlfDb) Put(ctx context.Context, tlfID tlf.ID, indexedRev, startedRev kbfsmd.Revision) error
- func (db *IndexedTlfDb) Shutdown(ctx context.Context)
- type Indexer
- func (i *Indexer) FullSyncStarted(ctx context.Context, tlfID tlf.ID, rev kbfsmd.Revision, waitCh <-chan struct{})
- func (i *Indexer) Progress() *Progress
- func (i *Indexer) ResetIndex(ctx context.Context) (err error)
- func (i *Indexer) Search(ctx context.Context, query string, numResults, startingResult int) (results []Result, nextResult int, err error)
- func (i *Indexer) Shutdown(ctx context.Context) error
- func (i *Indexer) SyncModeChanged(ctx context.Context, tlfID tlf.ID, newMode keybase1.FolderSyncMode)
- func (i *Indexer) UserChanged(ctx context.Context, oldName, newName kbname.NormalizedUsername)
- type OldPtrNotFound
- type Progress
- type Result
- type RevisionGCdError
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.
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.
type IndexedBlockDb ¶
type IndexedBlockDb struct {
// contains filtered or unexported fields
}
IndexedBlockDb is a database that holds metadata about indexed blocks.
func (*IndexedBlockDb) ClearMemory ¶
func (db *IndexedBlockDb) ClearMemory() error
ClearMemory clears out the buffered puts from memory.
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 uint64, docID string, dirDone bool, 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 uint64, docID string, dirDone bool) error
Put saves the version and doc ID for the given block.
func (*IndexedBlockDb) PutMemory ¶
func (db *IndexedBlockDb) PutMemory( ctx context.Context, tlfID tlf.ID, ptr data.BlockPointer, indexVersion uint64, docID string, dirDone bool) ( flushFn func() error, err error)
PutMemory saves the data to memory, and returns a function that will flush it to disk when the caller is ready.
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) 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 ¶
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) ResetIndex ¶
ResetIndex shuts down the current indexer, completely removes its on-disk presence, and then restarts it as a blank index.
func (*Indexer) Search ¶
func (i *Indexer) Search( ctx context.Context, query string, numResults, startingResult int) ( results []Result, nextResult int, err error)
Search executes the given query and returns the results in the form of full KBFS paths to each hit. `numResults` limits the number of returned results, and `startingResult` indicates the number of results that have been previously fetched -- basically it indicates the starting index number of the next page of desired results. The return parameter `nextResult` indicates what `startingResult` could be set to next time, to get more results, where -1 indicates that there are no more results.
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.
type OldPtrNotFound ¶
type OldPtrNotFound struct {
OldPtr data.BlockPointer
}
OldPtrNotFound indicates that the old pointer for a given file couldn't be found in the index.
func (OldPtrNotFound) Error ¶
func (e OldPtrNotFound) Error() string
type Progress ¶
type Progress struct {
// contains filtered or unexported fields
}
Progress represents the current state of the indexer, and how far along the indexing is.
func NewProgress ¶
NewProgress creates a new Progress instance.