Quellcode durchsuchen

add json tags to acl rules

abhishek9686 vor 9 Monaten
Ursprung
Commit
5e240c23cc
1 geänderte Dateien mit 7 neuen und 6 gelöschten Zeilen
  1. 7 6
      models/acl.go

+ 7 - 6
models/acl.go

@@ -93,10 +93,11 @@ type ProtocolType struct {
 }
 
 type AclRule struct {
-	SrcIP     net.IPNet
-	SrcIP6    net.IPNet
-	Proto     []Protocol // tcp, udp, etc.
-	Port      []int
-	Direction AllowedTrafficDirection // inbound or outbound
-	Allowed   bool
+	ID        string                  `json:"id"`
+	SrcIP     net.IPNet               `json:"src_ip"`
+	SrcIP6    net.IPNet               `json:"dst_ip"`
+	Proto     []Protocol              `json:"protocol"` // tcp, udp etc.
+	Port      []int                   `json:"port"`
+	Direction AllowedTrafficDirection `json:"direction"` // inbound or outbound
+	Allowed   bool                    `json:"allowed"`
 }