Documentation ¶
Index ¶
- type MongoDBClient
- func (client *MongoDBClient) CountDocumentsInMongo(databaseName string, collection string) (int, error)
- func (client *MongoDBClient) DatabaseExists(nameDatabase string) (bool, error)
- func (client *MongoDBClient) FindDocumentsInMongo(databaseName string, collection string, interval int, skip int, ...) error
- func (client *MongoDBClient) GetAllCollections(nameDatabase string) ([]string, error)
- type MongoDBClientConfigData
- type MongoDBMethodInterface
- type MongoDBRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDBClient ¶
func ConnectToMongoDB ¶
func ConnectToMongoDB(mongoDBClientConfig *MongoDBClientConfigData) (*MongoDBClient, error)
func (*MongoDBClient) CountDocumentsInMongo ¶
func (client *MongoDBClient) CountDocumentsInMongo(databaseName string, collection string) (int, error)
func (*MongoDBClient) DatabaseExists ¶
func (client *MongoDBClient) DatabaseExists(nameDatabase string) (bool, error)
func (*MongoDBClient) FindDocumentsInMongo ¶
func (*MongoDBClient) GetAllCollections ¶
func (client *MongoDBClient) GetAllCollections(nameDatabase string) ([]string, error)
type MongoDBClientConfigData ¶
type MongoDBClientConfigData struct { Scheme string Username string Password string Host string Port string Database string }
func MongoDBClientConfig ¶
func MongoDBClientConfig() (mongoDBClientConfig *MongoDBClientConfigData, err error)
Retrieve configuration data (eg.host, port, etc.) from .env file for production settings only Base parameter for dependency injection of mongodb client (production)
func (*MongoDBClientConfigData) GetURI ¶
func (mongoDBClientConfig *MongoDBClientConfigData) GetURI() (string, error)
GetURI returns the MongoDB connection URI based on the configuration.
type MongoDBMethodInterface ¶
type MongoDBMethodInterface struct {
MethodInterface MongoDBRepository
}
func NewMongoDBMethodInterface ¶
func NewMongoDBMethodInterface(mongoClient *MongoDBClient) *MongoDBMethodInterface
type MongoDBRepository ¶
type MongoDBRepository interface { CountDocumentsInMongo(databaseName string, collection string) (int, error) GetAllCollections(nameDatabase string) ([]string, error) FindDocumentsInMongo(databaseName string, collection string, interval int, skip int, result interface{}) error }
/////////////////////////////////////////////////////////////////////////// Setup interface for database repository utilizing Dependency Injection ///////////////////
Click to show internal directories.
Click to hide internal directories.