Documentation ¶
Overview ¶
Package database contains methods used to perform CRUD operations to the MongoDB database
Package database contains methods used to perform CRUD operations to the MongoDB database ¶
Package database contains methods used to perform CRUD operations to the MongoDB database
Index ¶
- func FilterByLocationAndEnvironmentSteps(location string, environment string) interface{}
- func FilterByOldnessSteps(olderThan time.Time) bson.A
- type MongoDatabase
- func (md *MongoDatabase) ConnectToMongodb()
- func (md *MongoDatabase) GetOracleDatabaseChartByVersion(location string, environment string, olderThan time.Time) ([]dto.ChartBubble, utils.AdvancedErrorInterface)
- func (md *MongoDatabase) GetOracleDatabaseChartByWork(location string, environment string, olderThan time.Time) ([]dto.ChartBubble, utils.AdvancedErrorInterface)
- func (md *MongoDatabase) GetOracleDbLicenseHistory() ([]dto.OracleDatabaseLicenseHistory, error)
- func (md *MongoDatabase) GetTechnologyCount(location string, environment string, olderThan time.Time) (map[string]float64, utils.AdvancedErrorInterface)
- func (md *MongoDatabase) Init()
- type MongoDatabaseInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterByLocationAndEnvironmentSteps ¶
FilterByLocationAndEnvironmentSteps return the steps required to filter the data by the location and environment field.
Types ¶
type MongoDatabase ¶
type MongoDatabase struct { // Config contains the dataservice global configuration Config config.Configuration // Client contain the mongodb client Client *mongo.Client // TimeNow contains a function that return the current time TimeNow func() time.Time // Log contains logger formatted Log *logrus.Logger // OperatingSystemAggregationRules contains rules used to aggregate various operating systems OperatingSystemAggregationRules []config.AggregationRule }
MongoDatabase is a implementation
func (*MongoDatabase) ConnectToMongodb ¶
func (md *MongoDatabase) ConnectToMongodb()
ConnectToMongodb connects to the MongoDB and return the connection
func (*MongoDatabase) GetOracleDatabaseChartByVersion ¶
func (md *MongoDatabase) GetOracleDatabaseChartByVersion(location string, environment string, olderThan time.Time) ([]dto.ChartBubble, utils.AdvancedErrorInterface)
GetOracleDatabaseChartByVersion return the chart data about oracle database version
func (*MongoDatabase) GetOracleDatabaseChartByWork ¶
func (md *MongoDatabase) GetOracleDatabaseChartByWork(location string, environment string, olderThan time.Time) ([]dto.ChartBubble, utils.AdvancedErrorInterface)
GetOracleDatabaseChartByWork return the chart data about the work of all database
func (*MongoDatabase) GetOracleDbLicenseHistory ¶
func (md *MongoDatabase) GetOracleDbLicenseHistory() ([]dto.OracleDatabaseLicenseHistory, error)
func (*MongoDatabase) GetTechnologyCount ¶
func (md *MongoDatabase) GetTechnologyCount(location string, environment string, olderThan time.Time) (map[string]float64, utils.AdvancedErrorInterface)
GetTechnologyCount return the number of occurence per technology
func (*MongoDatabase) Init ¶
func (md *MongoDatabase) Init()
Init initializes the connection to the database
type MongoDatabaseInterface ¶
type MongoDatabaseInterface interface { // Init initializes the connection to the database Init() // GetTechnologyCount return the number of occurence per technology GetTechnologyCount(location string, environment string, olderThan time.Time) (map[string]float64, utils.AdvancedErrorInterface) // GetOracleDatabaseChartByVersion return the chart data about oracle database version GetOracleDatabaseChartByVersion(location string, environment string, olderThan time.Time) ([]dto.ChartBubble, utils.AdvancedErrorInterface) // GetOracleDatabaseChartByWork return the chart data about the work of all database GetOracleDatabaseChartByWork(location string, environment string, olderThan time.Time) ([]dto.ChartBubble, utils.AdvancedErrorInterface) GetOracleDbLicenseHistory() ([]dto.OracleDatabaseLicenseHistory, error) }
MongoDatabaseInterface is a interface that wrap methods used to perform CRUD operations in the mongodb database