mongodb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() (*mongo.Client, error)

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

func InsertBaseLog(Client *mongo.Client, log pkg.BaseLog) error

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.

Jump to

Keyboard shortcuts

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