Added couple of func description comments

pull/17/head
Paulo Truta 2021-06-21 16:08:41 +00:00
parent bff0f6f817
commit 55fe955d27
2 changed files with 5 additions and 0 deletions

View File

@ -12,12 +12,14 @@ import (
) )
// GetUptimeInSeconds: Returns a value (as string) of the total system uptime
func GetUptimeInSeconds() string { func GetUptimeInSeconds() string {
uptime, _ := host.Uptime() uptime, _ := host.Uptime()
return strconv.FormatUint(uptime, 10) return strconv.FormatUint(uptime, 10)
} }
// GetUptimeFormatted: Returns a humanized version that can be useful for logging
func GetUptimeFormatted() string { func GetUptimeFormatted() string {
uptime, _ := host.Uptime() uptime, _ := host.Uptime()
@ -27,6 +29,7 @@ func GetUptimeFormatted() string {
return fmt.Sprintf("%d days, %d hours, %d minutes", days, hours, minutes) return fmt.Sprintf("%d days, %d hours, %d minutes", days, hours, minutes)
} }
// GetIP: Returns the ip address of the instance
func GetIP() string { func GetIP() string {
ip := "" ip := ""
@ -57,6 +60,7 @@ func GetHostname() string {
return utils.Exec("/", "hostname", []string{}) return utils.Exec("/", "hostname", []string{})
} }
// SetupCloudOptions: Reads the designated env file looking for options to write into the options table. Meant to be used on initial setup. Deletes source env file after operation.
func SetupCloudOptions() { func SetupCloudOptions() {
var cloudEnv map[string]string var cloudEnv map[string]string

View File

@ -163,6 +163,7 @@ func GetPath(pathKey string) string {
} }
// WriteOption : Writes a key value pair option into the api shared database
func WriteOption(optionKey string, optionValue string) { func WriteOption(optionKey string, optionValue string) {
db, err := sql.Open("sqlite3", GetSQLiteDbConnectionDetails()) db, err := sql.Open("sqlite3", GetSQLiteDbConnectionDetails())