瀏覽代碼

add json tags to acl rules

abhishek9686 9 月之前
父節點
當前提交
5e240c23cc
共有 1 個文件被更改,包括 7 次插入6 次删除
  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"`
 }