Browse Source

added comments

Abhishek Kondur 2 years ago
parent
commit
91cc77ee5b
3 changed files with 3 additions and 0 deletions
  1. 1 0
      logic/server.go
  2. 1 0
      logic/serverconf.go
  3. 1 0
      models/structs.go

+ 1 - 0
logic/server.go

@@ -314,6 +314,7 @@ func AddServerIDIfNotPresent() error {
 	return nil
 }
 
+// GetServerCount - fetches server count from DB
 func GetServerCount() int {
 	if record, err := database.FetchRecord(database.SERVERCONF_TABLE_NAME, server_id_key); err == nil {
 		currentServerIDs := models.ServerIDs{}

+ 1 - 0
logic/serverconf.go

@@ -6,6 +6,7 @@ import (
 	"github.com/gravitl/netmaker/database"
 )
 
+// constant for database key for storing server ids
 const server_id_key = "nm-server-id"
 
 type serverData struct {

+ 1 - 0
models/structs.go

@@ -225,6 +225,7 @@ func (user *User) NameInCharSet() bool {
 	return true
 }
 
+// ServerIDs - struct to hold server ids.
 type ServerIDs struct {
 	ServerIDs []string `json:"server_ids"`
 }