added mq and database connected funcs and endpoint

This commit is contained in:
0xdcarns
2023-02-06 12:09:21 -05:00
parent f4851937c1
commit 7a2c225eb1
6 changed files with 61 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ var PG_FUNCTIONS = map[string]interface{}{
DELETE_ALL: pgDeleteAllRecords,
FETCH_ALL: pgFetchRecords,
CLOSE_DB: pgCloseDB,
isConnected: pgIsConnected,
}
func getPGConnString() string {
@@ -135,3 +136,8 @@ func pgFetchRecords(tableName string) (map[string]string, error) {
func pgCloseDB() {
PGDB.Close()
}
func pgIsConnected() bool {
stats := PGDB.Stats()
return stats.OpenConnections > 0
}