Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultDatabaseName string
)
Functions ¶
func Session ¶
func Session(log logrus.FieldLogger) *mgo.Session
Session tries to open a session against a MongoDB database in a loop. The argument is NOT a context but a logger for the following reason. We create an initial connection and clone it. It means that only the initial session will have a context. Once this context expires the initial session is closed, and cloning it is not possible anymore, leading to errors in all cloned sessions. The linter `contextcheck` may complain that this function does not take a context in argument. In such case, add the following comment before the line calling this function: "//nolint: contextcheck"
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.