Browse Source

add json tags

Abhishek Kondur 2 years ago
parent
commit
be741c1b44
1 changed files with 8 additions and 8 deletions
  1. 8 8
      models/mqtt.go

+ 8 - 8
models/mqtt.go

@@ -32,20 +32,20 @@ type HostPeerUpdate struct {
 }
 }
 
 
 type IngressInfo struct {
 type IngressInfo struct {
-	ExtPeers map[string]ExtClientInfo
+	ExtPeers map[string]ExtClientInfo `json:"ext_peers" yaml:"ext_peers"`
 }
 }
 
 
 type PeerExtInfo struct {
 type PeerExtInfo struct {
-	PeerAddr net.IPNet
-	PeerKey  wgtypes.Key
-	Allow    bool
+	PeerAddr net.IPNet   `json:"peer_addr" yaml:"peer_addr"`
+	PeerKey  wgtypes.Key `json:"peer_key" yaml:"peer_key"`
+	Allow    bool        `json:"allow" yaml:"allow"`
 }
 }
 
 
 type ExtClientInfo struct {
 type ExtClientInfo struct {
-	Masquerade  bool
-	ExtPeerAddr net.IPNet
-	ExtPeerKey  wgtypes.Key
-	Peers       map[string]PeerExtInfo
+	Masquerade  bool                   `json:"masquerade" yaml:"masquerade"`
+	ExtPeerAddr net.IPNet              `json:"ext_peer_addr" yaml:"ext_peer_addr"`
+	ExtPeerKey  wgtypes.Key            `json:"ext_peer_key" yaml:"ext_peer_key"`
+	Peers       map[string]PeerExtInfo `json:"peers" yaml:"peers"`
 }
 }
 
 
 // NetworkInfo - struct for network info
 // NetworkInfo - struct for network info