Prechádzať zdrojové kódy

add json tags to acl rules

abhishek9686 9 mesiacov pred
rodič
commit
5e240c23cc
1 zmenil súbory, kde vykonal 7 pridanie a 6 odobranie
  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"`
 }