Documentation ¶
Index ¶
- func GetConnection() (*gorm.DB, *mongo.Client, *elasticsearch.Client, error)
- func InsertBaseLog(db *gorm.DB, log pkg.LogDetails) error
- func InsertDatabaseLog(db *gorm.DB, log pkg.LogDatabase) error
- func InsertFunctionLog(db *gorm.DB, log pkg.LogFunction) error
- func InsertRequestLog(db *gorm.DB, log pkg.LogRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConnection ¶
GetConnection retrieves the database connection based on the DATABASE_TYPE environment variable.
It returns the *gorm.DB, *mongo.Client, *elasticsearch.Client connections, and an error.
func InsertBaseLog ¶
func InsertBaseLog(db *gorm.DB, log pkg.LogDetails) error
InsertBaseLog inserts a LogDetails into the database.
It takes a *gorm.DB and a pkg.LogDetails as parameters. It returns an error.
func InsertDatabaseLog ¶
func InsertDatabaseLog(db *gorm.DB, log pkg.LogDatabase) error
InsertDatabaseLog inserts a database log into the given *gorm.DB instance.
It takes the following parameter(s): - db: a pointer to a gorm.DB instance representing the database connection. - log: a pkg.LogDatabase struct representing the log to be inserted.
It returns an error if there was an issue inserting the log.
func InsertFunctionLog ¶
func InsertFunctionLog(db *gorm.DB, log pkg.LogFunction) error
InsertFunctionLog inserts a function log into the database.
Parameters: - db: The gorm.DB object representing the database connection. - log: The pkg.LogFunction object representing the function log to be inserted.
Returns: - error: An error, if any occurred during the database insert operation.
func InsertRequestLog ¶
func InsertRequestLog(db *gorm.DB, log pkg.LogRequest) error
InsertRequestLog inserts a request log into the database.
It takes a *gorm.DB object as the first parameter, which represents the database connection, and a pkg.LogRequest object as the second parameter, which contains the request log data.
It returns an error if there was an issue inserting the request log into the database.
Types ¶
This section is empty.