mongoutils

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2022 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMongoConnectionStringFromEnv

func GetMongoConnectionStringFromEnv() (string, string, error)

GetMongoConnectionStringFromEnv returns a mongodb connection string and the database name by considering the following environment variables: MONGODB_DATABASE - The name of the database within the mongodb service (e.g. keptn) MONGODB_EXTERNAL_CONNECTION_STRING - If this variable is set, the function will return this value. Otherwise, it will construct the connection string from the following variables. MONGODB_HOST - The host name (including the port) of the mongodb service (e.g. mongo:27017) MONGODB_USER - The username of the database MONGODB_PASSWORD - The password of the user The resulting constructed string is compatible with the mongodb services that is deployed by default as part of Keptn core, and looks as follows: mongodb://<MONGODB_USER>:<MONGODB_PASSWORD>@MONGODB_HOST>/<MONGODB_DATABASE>

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL