adding comments

This commit is contained in:
afeiszli 2023-03-03 10:52:05 -05:00
parent dba954c529
commit b6bea3b06c

View file

@ -177,7 +177,7 @@ func GetAPIPort() string {
return apiport return apiport
} }
// GetStunAddr - gets the stun host address // GetStunList - gets the stun servers
func GetStunList() []models.StunServer { func GetStunList() []models.StunServer {
stunList := []models.StunServer{ stunList := []models.StunServer{
models.StunServer{ models.StunServer{
@ -206,6 +206,7 @@ func GetStunList() []models.StunServer {
return stunList return stunList
} }
// GetStunList - gets the stun servers w/o parsing to struct
func GetStunListString() string { func GetStunListString() string {
stunList := "stun1.netmaker.io:3478,stun2.netmaker.io:3478" stunList := "stun1.netmaker.io:3478,stun2.netmaker.io:3478"
if os.Getenv("STUN_LIST") != "" { if os.Getenv("STUN_LIST") != "" {
@ -610,6 +611,7 @@ func GetNetmakerAccountID() string {
return netmakerAccountID return netmakerAccountID
} }
// GetStunPort - Get the port to run the stun server on
func GetStunPort() int { func GetStunPort() int {
port := 3478 //default port := 3478 //default
if os.Getenv("STUN_PORT") != "" { if os.Getenv("STUN_PORT") != "" {
@ -623,6 +625,7 @@ func GetStunPort() int {
return port return port
} }
// IsProxyEnabled - is proxy on or off
func IsProxyEnabled() bool { func IsProxyEnabled() bool {
var enabled = false //default var enabled = false //default
if os.Getenv("PROXY") != "" { if os.Getenv("PROXY") != "" {
@ -633,6 +636,7 @@ func IsProxyEnabled() bool {
return enabled return enabled
} }
// parseStunList - turn string into slice of StunServers
func parseStunList(stunString string) ([]models.StunServer, error) { func parseStunList(stunString string) ([]models.StunServer, error) {
var err error var err error
stunServers := []models.StunServer{} stunServers := []models.StunServer{}