Package db encapsulates tsuru connection with MongoDB.
The function Conn dials to MongoDB using data from the configuration file and returns a connection (represented by the storage.Storage type). It manages an internal pool of connections, and reconnects in case of failures. That means that you should not store references to the connection, but always call Open.
const ( DefaultDatabaseURL = "127.0.0.1:27017" DefaultDatabaseName = "tsuru" )
AppLogCollection returns the logs collection for one app from MongoDB.
CreateAppLogCollection creates a new capped collection to store logs for an app.
LogsCollections returns logs collections for all apps from MongoDB.
Conn reads the tsuru config and calls storage.Open to get a database connection.
Most tsuru packages should probably use this function. storage.Open is intended for use when supporting more than one database.
Apps returns the apps collection from MongoDB.
Pools returns the pool collection.
PoolsConstraints return the pool constraints collection.
SAMLRequests returns the saml_requests from MongoDB.
ServiceInstances returns the services_instances collection from MongoDB.
Services returns the services collection from MongoDB.
Users returns the users collection from MongoDB.
|dbtest||Package dbtest provides utilities test functions and types for interacting with the database during tests.|