Documentation
¶
Index ¶
- type DB
- func (d *DB) AggregateCollection(sourceCollection string, session *mgo.Session, pipeline []bson.D) *mgo.Iter
- func (d *DB) CollectionExists(table string) bool
- func (d *DB) CreateCollection(name string, id bool, indeces []mgo.Index) error
- func (d *DB) GetSelectedDB() string
- func (d *DB) MapReduceCollection(sourceCollection string, job mgo.MapReduce) bool
- func (d *DB) SelectDB(db string)
- type DBMetaInfo
- type MetaDBHandle
- func (m *MetaDBHandle) AddNewDB(name string) error
- func (m *MetaDBHandle) AddParsedFiles(files []*fpt.IndexedFile) error
- func (m *MetaDBHandle) CheckCompatibleAnalyze(targetDatabase string) (bool, error)
- func (m *MetaDBHandle) CheckCompatibleImport(targetDatabase string) (bool, error)
- func (m *MetaDBHandle) DeleteDB(name string) error
- func (m *MetaDBHandle) GetAnalyzedDatabases() []string
- func (m *MetaDBHandle) GetDBMetaInfo(name string) (DBMetaInfo, error)
- func (m *MetaDBHandle) GetDatabases() []string
- func (m *MetaDBHandle) GetFiles() ([]fpt.IndexedFile, error)
- func (m *MetaDBHandle) GetUnAnalyzedDatabases() []string
- func (m *MetaDBHandle) MarkDBAnalyzed(name string, complete bool) error
- type Resources
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct { Session *mgo.Session // contains filtered or unexported fields }
DB is the workhorse container for messing with the database
func (*DB) AggregateCollection ¶ added in v1.0.0
func (d *DB) AggregateCollection(sourceCollection string, session *mgo.Session, pipeline []bson.D) *mgo.Iter
AggregateCollection builds a collection via a MongoDB pipeline
func (*DB) CollectionExists ¶ added in v1.0.0
CollectionExists returns true if collection exists in the currently selected database
func (*DB) CreateCollection ¶ added in v1.0.0
CreateCollection creates a new collection in the currently selected database with the required indeces
func (*DB) GetSelectedDB ¶ added in v1.0.0
GetSelectedDB retrieves the currently selected database for analysis
func (*DB) MapReduceCollection ¶ added in v1.0.0
MapReduceCollection builds collections via javascript map reduce jobs
type DBMetaInfo ¶
type DBMetaInfo struct { ID bson.ObjectId `bson:"_id,omitempty"` // Ident Name string `bson:"name"` // Top level name of the database Analyzed bool `bson:"analyzed"` // Has this database been analyzed ImportVersion string `bson:"import_version"` // Rita version at import AnalyzeVersion string `bson:"analyze_version"` // Rita version at analyze }
DBMetaInfo defines some information about the database
type MetaDBHandle ¶
type MetaDBHandle struct { DB string // Database path // contains filtered or unexported fields }
MetaDBHandle exports control for the meta database
func (*MetaDBHandle) AddNewDB ¶
func (m *MetaDBHandle) AddNewDB(name string) error
AddNewDB adds a new database to the DBMetaInfo table
func (*MetaDBHandle) AddParsedFiles ¶ added in v1.0.0
func (m *MetaDBHandle) AddParsedFiles(files []*fpt.IndexedFile) error
AddParsedFiles adds indexed files to the files the metaDB using the bulk API
func (*MetaDBHandle) CheckCompatibleAnalyze ¶ added in v1.0.0
func (m *MetaDBHandle) CheckCompatibleAnalyze(targetDatabase string) (bool, error)
CheckCompatibleAnalyze checks if a database was analyzed with a version of RITA which is compatible with the running version
func (*MetaDBHandle) CheckCompatibleImport ¶ added in v1.0.0
func (m *MetaDBHandle) CheckCompatibleImport(targetDatabase string) (bool, error)
CheckCompatibleImport checks if a database was imported with a version of RITA which is compatible with the running version
func (*MetaDBHandle) DeleteDB ¶ added in v1.0.0
func (m *MetaDBHandle) DeleteDB(name string) error
DeleteDB removes a database managed by RITA
func (*MetaDBHandle) GetAnalyzedDatabases ¶ added in v1.0.0
func (m *MetaDBHandle) GetAnalyzedDatabases() []string
GetAnalyzedDatabases builds a list of database names which have been analyzed
func (*MetaDBHandle) GetDBMetaInfo ¶ added in v1.0.0
func (m *MetaDBHandle) GetDBMetaInfo(name string) (DBMetaInfo, error)
GetDBMetaInfo returns a meta db entry
func (*MetaDBHandle) GetDatabases ¶
func (m *MetaDBHandle) GetDatabases() []string
GetDatabases returns a list of databases being tracked in metadb or an empty array on failure
func (*MetaDBHandle) GetFiles ¶
func (m *MetaDBHandle) GetFiles() ([]fpt.IndexedFile, error)
GetFiles gets a list of all IndexedFile objects in the database if successful return a list of files from the database, in the case of failure return a zero length list of files and generat a log message.
func (*MetaDBHandle) GetUnAnalyzedDatabases ¶ added in v1.0.0
func (m *MetaDBHandle) GetUnAnalyzedDatabases() []string
GetUnAnalyzedDatabases builds a list of database names which have yet to be analyzed
func (*MetaDBHandle) MarkDBAnalyzed ¶ added in v1.0.0
func (m *MetaDBHandle) MarkDBAnalyzed(name string, complete bool) error
MarkDBAnalyzed marks a database as having been analyzed
type Resources ¶ added in v1.0.0
Resources provides a data structure for passing system Resources
func InitMockResources ¶ added in v1.0.0
InitMockResources grabs the configuration file and intitializes the configuration data returning a *Resources object which has all of the necessary configuration information
func InitResources ¶ added in v1.0.0
InitResources grabs the configuration file and intitializes the configuration data returning a *Resources object which has all of the necessary configuration information