mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-09-29 16:15:41 +02:00
Added couple of func description comments
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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())
|
||||||
|
|||||||
Reference in New Issue
Block a user