Documentation
¶
Overview ¶
Package db contains our database interface for dfind.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Search ¶
func Search(pattern string, ignoreCase, searchContent bool, dataDir string) ([]*drivers.DBObj, error)
Search is our top level search function. it should only be used when you do not need to do anything except a single search. It is also a good example of how to implement channel based searches
Types ¶
type DB ¶
type DB struct { ReadOnly bool // the searcher should only connect read only Driver drivers.DBDriver // our actual driver }
DB holds our database connection. It is used by both the searcher and scanner to access the database.
func New ¶
New will connect to our database(s) and return a DB instance that can be used to access the database
func (*DB) Search ¶
Search is our normal search mechanism, that can be called from any DB instance. There is also a package-level Search function, but, that allocates a DB instance on the fly, and should only be used when you don't need to do anything with the DB except for search. Returns: a channel that returns matches, and/or error.