Documentation ¶
Index ¶
- func Connect() (*mongo.Client, error)
- func InsertBaseLog(Client *mongo.Client, log pkg.BaseLog) error
- func InsertDatabaseLog(Client *mongo.Client, log pkg.DatabaseLog) error
- func InsertFunctionLog(Client *mongo.Client, log pkg.FunctionLog) error
- func InsertRequestLog(Client *mongo.Client, log pkg.RequestLog) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
Connect establishes a connection to the MongoDB database.
It takes no parameters. It returns a pointer to a mongo.Client and an error.
func InsertBaseLog ¶
InsertBaseLog inserts a base log into the specified MongoDB collection.
Client is the MongoDB client used to connect to the database. log is the base log to be inserted. Returns an error if the insertion fails.
func InsertDatabaseLog ¶
func InsertDatabaseLog(Client *mongo.Client, log pkg.DatabaseLog) error
InsertDatabaseLog inserts a database log into the specified collection.
It takes a mongo.Client object and a pkg.DatabaseLog object as parameters. It returns an error if the insertion fails.
func InsertFunctionLog ¶
func InsertFunctionLog(Client *mongo.Client, log pkg.FunctionLog) error
InsertFunctionLog inserts a function log into the "functionLogs" collection.
Client is a MongoDB client. log is the function log to be inserted. Returns an error if the insertion fails.
func InsertRequestLog ¶
func InsertRequestLog(Client *mongo.Client, log pkg.RequestLog) error
InsertRequestLog inserts a request log into the "requestLogs" collection in the MongoDB database.
Parameters: - Client: A pointer to a mongo.Client object representing the MongoDB client. - log: The request log to be inserted in the collection.
Returns: - error: An error, if any, encountered during the insertion process.
Types ¶
This section is empty.