Documentation ¶
Index ¶
- Variables
- 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, 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 LogInfo
- type MetaDB
- func (m *MetaDB) AddNewDB(name string) error
- func (m *MetaDB) AddParsedFiles(files []*fpt.IndexedFile) error
- func (m *MetaDB) CheckCompatibleAnalyze(targetDatabase string) (bool, error)
- func (m *MetaDB) CheckCompatibleImport(targetDatabase string) (bool, error)
- func (m *MetaDB) DeleteDB(name string) error
- func (m *MetaDB) GetAnalyzeReadyDatabases() []string
- func (m *MetaDB) GetAnalyzedDatabases() []string
- func (m *MetaDB) GetDBMetaInfo(name string) (DBMetaInfo, error)
- func (m *MetaDB) GetDatabases() []string
- func (m *MetaDB) GetFiles() ([]fpt.IndexedFile, error)
- func (m *MetaDB) GetUnAnalyzedDatabases() []string
- func (m *MetaDB) LastCheck() (time.Time, semver.Version)
- func (m *MetaDB) MarkDBAnalyzed(name string, complete bool) error
- func (m *MetaDB) MarkDBImported(name string, complete bool) error
Constants ¶
This section is empty.
Variables ¶
var MaxMongoDBVersion = semver.Version{
Major: 3,
Minor: 7,
Patch: 0,
}
MaxMongoDBVersion is the upper, exclusive bound on the versions of MongoDB compatible with RITA
var MinMongoDBVersion = semver.Version{
Major: 3,
Minor: 2,
Patch: 0,
}
MinMongoDBVersion is the lower, inclusive bound on the versions of MongoDB compatible with RITA
Functions ¶
This section is empty.
Types ¶
type DB ¶
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 ImportFinished bool `bson:"import_finished"` // Has this database been entirely imported 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 LogInfo ¶ added in v1.1.1
type LogInfo struct { ID bson.ObjectId `bson:"_id,omitempty"` // Ident Time time.Time `bson:"LastUpdateCheck"` // Top level name of the database Message string `bson:"Message"` // Top level name of the database Version string `bson:"NewestVersion"` // Top level name of the database }
LogInfo defines information about the UpdateChecker log
type MetaDB ¶ added in v1.0.2
type MetaDB struct {
// contains filtered or unexported fields
}
MetaDB exports control for the meta database
func (*MetaDB) AddParsedFiles ¶ added in v1.0.2
func (m *MetaDB) AddParsedFiles(files []*fpt.IndexedFile) error
AddParsedFiles adds indexed files to the files the metaDB using the bulk API
func (*MetaDB) CheckCompatibleAnalyze ¶ added in v1.0.2
CheckCompatibleAnalyze checks if a database was analyzed with a version of RITA which is compatible with the running version
func (*MetaDB) CheckCompatibleImport ¶ added in v1.0.2
CheckCompatibleImport checks if a database was imported with a version of RITA which is compatible with the running version
func (*MetaDB) GetAnalyzeReadyDatabases ¶ added in v1.1.0
GetAnalyzeReadyDatabases builds a list of database names which are ready to be analyzed
func (*MetaDB) GetAnalyzedDatabases ¶ added in v1.0.2
GetAnalyzedDatabases builds a list of database names which have been analyzed
func (*MetaDB) GetDBMetaInfo ¶ added in v1.0.2
func (m *MetaDB) GetDBMetaInfo(name string) (DBMetaInfo, error)
GetDBMetaInfo returns a meta db entry. This is the only function which returns DBMetaInfo to code outside of meta.go.
func (*MetaDB) GetDatabases ¶ added in v1.0.2
GetDatabases returns a list of databases being tracked in metadb or an empty array on failure
func (*MetaDB) GetFiles ¶ added in v1.0.2
func (m *MetaDB) 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 (*MetaDB) GetUnAnalyzedDatabases ¶ added in v1.0.2
GetUnAnalyzedDatabases builds a list of database names which have yet to be analyzed
func (*MetaDB) MarkDBAnalyzed ¶ added in v1.0.2
MarkDBAnalyzed marks a database as having been analyzed