mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-06 09:22:42 +08:00
added comments
This commit is contained in:
@@ -314,6 +314,7 @@ func AddServerIDIfNotPresent() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetServerCount - fetches server count from DB
|
||||||
func GetServerCount() int {
|
func GetServerCount() int {
|
||||||
if record, err := database.FetchRecord(database.SERVERCONF_TABLE_NAME, server_id_key); err == nil {
|
if record, err := database.FetchRecord(database.SERVERCONF_TABLE_NAME, server_id_key); err == nil {
|
||||||
currentServerIDs := models.ServerIDs{}
|
currentServerIDs := models.ServerIDs{}
|
||||||
|
@@ -6,6 +6,7 @@ import (
|
|||||||
"github.com/gravitl/netmaker/database"
|
"github.com/gravitl/netmaker/database"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// constant for database key for storing server ids
|
||||||
const server_id_key = "nm-server-id"
|
const server_id_key = "nm-server-id"
|
||||||
|
|
||||||
type serverData struct {
|
type serverData struct {
|
||||||
|
@@ -225,6 +225,7 @@ func (user *User) NameInCharSet() bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ServerIDs - struct to hold server ids.
|
||||||
type ServerIDs struct {
|
type ServerIDs struct {
|
||||||
ServerIDs []string `json:"server_ids"`
|
ServerIDs []string `json:"server_ids"`
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user