Forráskód Böngészése

add auto relay to api host

Abhishek Kondur 1 éve
szülő
commit
140ccfcdac
1 módosított fájl, 3 hozzáadás és 0 törlés
  1. 3 0
      models/api_host.go

+ 3 - 0
models/api_host.go

@@ -33,6 +33,7 @@ type ApiHost struct {
 	NatType             string   `json:"nat_type"              yaml:"nat_type"`
 	PersistentKeepalive int      `json:"persistentkeepalive"   yaml:"persistentkeepalive"`
 	AutoUpdate          bool     `json:"autoupdate"              yaml:"autoupdate"`
+	AutoRelay           bool     `json:"auto_relay" yaml:"auto_relay"`
 }
 
 // Host.ConvertNMHostToAPI - converts a Netmaker host to an API editable host
@@ -62,6 +63,7 @@ func (h *Host) ConvertNMHostToAPI() *ApiHost {
 	a.NatType = h.NatType
 	a.PersistentKeepalive = int(h.PersistentKeepalive.Seconds())
 	a.AutoUpdate = h.AutoUpdate
+	a.AutoRelay = h.AutoRelay
 	return &a
 }
 
@@ -101,5 +103,6 @@ func (a *ApiHost) ConvertAPIHostToNMHost(currentHost *Host) *Host {
 	h.TurnEndpoint = currentHost.TurnEndpoint
 	h.PersistentKeepalive = time.Duration(a.PersistentKeepalive) * time.Second
 	h.AutoUpdate = a.AutoUpdate
+	h.AutoRelay = a.AutoRelay
 	return &h
 }