Skip to content

Commit

Permalink
recompiled binaries using go-compiler and btf updates
Browse files Browse the repository at this point in the history
- sort definition files by priority (string -> int)
- Version::checkMinimal success message if same version
  • Loading branch information
fchastanet committed Sep 22, 2024
1 parent ccf4855 commit a56cafd
Show file tree
Hide file tree
Showing 18 changed files with 418 additions and 148 deletions.
43 changes: 33 additions & 10 deletions bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,19 @@ Log::displayInfo() {
}


# @description Display message using success color (bg green/fg white)
# @arg $1 message:String the message to display
# @env DISPLAY_DURATION int (default 0) if 1 display elapsed time information between 2 info logs
# @env LOG_CONTEXT String allows to contextualize the log
Log::displaySuccess() {
if ((BASH_FRAMEWORK_DISPLAY_LEVEL >= __LEVEL_INFO)); then
Log::computeDuration
echo -e "${__SUCCESS_COLOR}SUCCESS - ${LOG_CONTEXT:-}${LOG_LAST_DURATION_STR:-}${1}${__RESET_COLOR}" >&2
fi
Log::logSuccess "$1"
}


# @description Display message using warning color (yellow)
# @arg $1 message:String the message to display
# @env DISPLAY_DURATION int (default 0) if 1 display elapsed time information between 2 info logs
Expand Down Expand Up @@ -958,6 +971,15 @@ Log::logMessage() {
}


# @description log message to file
# @arg $1 message:String the message to display
Log::logSuccess() {
if ((BASH_FRAMEWORK_LOG_LEVEL >= __LEVEL_INFO)); then
Log::logMessage "${2:-SUCCESS}" "$1"
fi
}


# @description log message to file
# @arg $1 message:String the message to display
Log::logWarning() {
Expand Down Expand Up @@ -1188,17 +1210,20 @@ Version::checkMinimal() {

Log::displayDebug "check ${commandName} version ${version} against minimal ${minimalVersion}"

Version::compare "${version}" "${minimalVersion}" || {
local result=$?
if [[ "${result}" = "1" ]]; then
local result=0
Version::compare "${version}" "${minimalVersion}" || result=$?
case "${result}" in
1)
Log::displayInfo "${commandName} version is ${version} greater than ${minimalVersion}"
elif [[ "${result}" = "2" ]]; then
;;
2)
Log::displayError "${commandName} minimal version is ${minimalVersion}, your version is ${version}"
return 1
fi
return 0
}

;;
*)
Log::displaySuccess "${commandName} version is matching exactly the expected minimal version ${version}"
;;
esac
}


Expand Down Expand Up @@ -1251,7 +1276,6 @@ Version::parse() {
}
# FUNCTIONS


declare -a BASH_FRAMEWORK_ARGV_FILTERED=()

beforeParseCallback() {
Expand Down Expand Up @@ -2054,7 +2078,6 @@ cliCommandParse() {
cliCommandHelp() {
echo -e "${__HELP_TITLE_COLOR}SYNOPSIS:${__RESET_COLOR}"
Array::wrap2 ' ' 76 4 " " "Easy connection to docker container."

echo
echo

Expand Down
43 changes: 33 additions & 10 deletions bin/dbImport
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,19 @@ Log::displayInfo() {
}


# @description Display message using success color (bg green/fg white)
# @arg $1 message:String the message to display
# @env DISPLAY_DURATION int (default 0) if 1 display elapsed time information between 2 info logs
# @env LOG_CONTEXT String allows to contextualize the log
Log::displaySuccess() {
if ((BASH_FRAMEWORK_DISPLAY_LEVEL >= __LEVEL_INFO)); then
Log::computeDuration
echo -e "${__SUCCESS_COLOR}SUCCESS - ${LOG_CONTEXT:-}${LOG_LAST_DURATION_STR:-}${1}${__RESET_COLOR}" >&2
fi
Log::logSuccess "$1"
}


# @description Display message using warning color (yellow)
# @arg $1 message:String the message to display
# @env DISPLAY_DURATION int (default 0) if 1 display elapsed time information between 2 info logs
Expand Down Expand Up @@ -1188,6 +1201,15 @@ Log::logMessage() {
}


# @description log message to file
# @arg $1 message:String the message to display
Log::logSuccess() {
if ((BASH_FRAMEWORK_LOG_LEVEL >= __LEVEL_INFO)); then
Log::logMessage "${2:-SUCCESS}" "$1"
fi
}


# @description log message to file
# @arg $1 message:String the message to display
Log::logWarning() {
Expand Down Expand Up @@ -1418,17 +1440,20 @@ Version::checkMinimal() {

Log::displayDebug "check ${commandName} version ${version} against minimal ${minimalVersion}"

Version::compare "${version}" "${minimalVersion}" || {
local result=$?
if [[ "${result}" = "1" ]]; then
local result=0
Version::compare "${version}" "${minimalVersion}" || result=$?
case "${result}" in
1)
Log::displayInfo "${commandName} version is ${version} greater than ${minimalVersion}"
elif [[ "${result}" = "2" ]]; then
;;
2)
Log::displayError "${commandName} minimal version is ${minimalVersion}, your version is ${version}"
return 1
fi
return 0
}

;;
*)
Log::displaySuccess "${commandName} version is matching exactly the expected minimal version ${version}"
;;
esac
}


Expand Down Expand Up @@ -1481,7 +1506,6 @@ Version::parse() {
}
# FUNCTIONS


declare -a BASH_FRAMEWORK_ARGV_FILTERED=()

beforeParseCallback() {
Expand Down Expand Up @@ -2586,7 +2610,6 @@ dbImportCommandParse() {
dbImportCommandHelp() {
echo -e "${__HELP_TITLE_COLOR}SYNOPSIS:${__RESET_COLOR}"
Array::wrap2 ' ' 76 4 " " "Import source db into target db using eventual table filter."

echo
echo

Expand Down
43 changes: 33 additions & 10 deletions bin/dbImportProfile
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,19 @@ Log::displayInfo() {
}


# @description Display message using success color (bg green/fg white)
# @arg $1 message:String the message to display
# @env DISPLAY_DURATION int (default 0) if 1 display elapsed time information between 2 info logs
# @env LOG_CONTEXT String allows to contextualize the log
Log::displaySuccess() {
if ((BASH_FRAMEWORK_DISPLAY_LEVEL >= __LEVEL_INFO)); then
Log::computeDuration
echo -e "${__SUCCESS_COLOR}SUCCESS - ${LOG_CONTEXT:-}${LOG_LAST_DURATION_STR:-}${1}${__RESET_COLOR}" >&2
fi
Log::logSuccess "$1"
}


# @description Display message using warning color (yellow)
# @arg $1 message:String the message to display
# @env DISPLAY_DURATION int (default 0) if 1 display elapsed time information between 2 info logs
Expand Down Expand Up @@ -1067,6 +1080,15 @@ Log::logMessage() {
}


# @description log message to file
# @arg $1 message:String the message to display
Log::logSuccess() {
if ((BASH_FRAMEWORK_LOG_LEVEL >= __LEVEL_INFO)); then
Log::logMessage "${2:-SUCCESS}" "$1"
fi
}


# @description log message to file
# @arg $1 message:String the message to display
Log::logWarning() {
Expand Down Expand Up @@ -1297,17 +1319,20 @@ Version::checkMinimal() {

Log::displayDebug "check ${commandName} version ${version} against minimal ${minimalVersion}"

Version::compare "${version}" "${minimalVersion}" || {
local result=$?
if [[ "${result}" = "1" ]]; then
local result=0
Version::compare "${version}" "${minimalVersion}" || result=$?
case "${result}" in
1)
Log::displayInfo "${commandName} version is ${version} greater than ${minimalVersion}"
elif [[ "${result}" = "2" ]]; then
;;
2)
Log::displayError "${commandName} minimal version is ${minimalVersion}, your version is ${version}"
return 1
fi
return 0
}

;;
*)
Log::displaySuccess "${commandName} version is matching exactly the expected minimal version ${version}"
;;
esac
}


Expand Down Expand Up @@ -1360,7 +1385,6 @@ Version::parse() {
}
# FUNCTIONS


declare -a BASH_FRAMEWORK_ARGV_FILTERED=()

beforeParseCallback() {
Expand Down Expand Up @@ -2281,7 +2305,6 @@ dbImportProfileCommandParse() {
dbImportProfileCommandHelp() {
echo -e "${__HELP_TITLE_COLOR}SYNOPSIS:${__RESET_COLOR}"
Array::wrap2 ' ' 76 4 " " "Generate optimized profiles to be used by dbImport."

echo
echo

Expand Down
43 changes: 33 additions & 10 deletions bin/dbImportStream
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,19 @@ Log::displayInfo() {
}


# @description Display message using success color (bg green/fg white)
# @arg $1 message:String the message to display
# @env DISPLAY_DURATION int (default 0) if 1 display elapsed time information between 2 info logs
# @env LOG_CONTEXT String allows to contextualize the log
Log::displaySuccess() {
if ((BASH_FRAMEWORK_DISPLAY_LEVEL >= __LEVEL_INFO)); then
Log::computeDuration
echo -e "${__SUCCESS_COLOR}SUCCESS - ${LOG_CONTEXT:-}${LOG_LAST_DURATION_STR:-}${1}${__RESET_COLOR}" >&2
fi
Log::logSuccess "$1"
}


# @description Display message using warning color (yellow)
# @arg $1 message:String the message to display
# @env DISPLAY_DURATION int (default 0) if 1 display elapsed time information between 2 info logs
Expand Down Expand Up @@ -1095,6 +1108,15 @@ Log::logMessage() {
}


# @description log message to file
# @arg $1 message:String the message to display
Log::logSuccess() {
if ((BASH_FRAMEWORK_LOG_LEVEL >= __LEVEL_INFO)); then
Log::logMessage "${2:-SUCCESS}" "$1"
fi
}


# @description log message to file
# @arg $1 message:String the message to display
Log::logWarning() {
Expand Down Expand Up @@ -1325,17 +1347,20 @@ Version::checkMinimal() {

Log::displayDebug "check ${commandName} version ${version} against minimal ${minimalVersion}"

Version::compare "${version}" "${minimalVersion}" || {
local result=$?
if [[ "${result}" = "1" ]]; then
local result=0
Version::compare "${version}" "${minimalVersion}" || result=$?
case "${result}" in
1)
Log::displayInfo "${commandName} version is ${version} greater than ${minimalVersion}"
elif [[ "${result}" = "2" ]]; then
;;
2)
Log::displayError "${commandName} minimal version is ${minimalVersion}, your version is ${version}"
return 1
fi
return 0
}

;;
*)
Log::displaySuccess "${commandName} version is matching exactly the expected minimal version ${version}"
;;
esac
}


Expand Down Expand Up @@ -1388,7 +1413,6 @@ Version::parse() {
}
# FUNCTIONS


declare -a BASH_FRAMEWORK_ARGV_FILTERED=()

beforeParseCallback() {
Expand Down Expand Up @@ -2351,7 +2375,6 @@ dbImportStreamCommandParse() {
dbImportStreamCommandHelp() {
echo -e "${__HELP_TITLE_COLOR}SYNOPSIS:${__RESET_COLOR}"
Array::wrap2 ' ' 76 4 " " "Stream tar.gz file or gz file through mysql."

echo
echo

Expand Down
Loading

0 comments on commit a56cafd

Please sign in to comment.