Browse Source

define acl model

abhishek9686 11 months ago
parent
commit
873d3ea8d8
1 changed files with 27 additions and 0 deletions
  1. 27 0
      models/acl.go

+ 27 - 0
models/acl.go

@@ -0,0 +1,27 @@
+package models
+
+type SrcType string
+type DstType string
+
+// AllowedTrafficDirection - allowed direction of traffic
+type AllowedTrafficDirection int
+
+const (
+	// TrafficDirectionUni implies traffic is only allowed in one direction (src --> dst)
+	TrafficDirectionUni AllowedTrafficDirection = iota
+	// TrafficDirectionBi implies traffic is allowed both direction (src <--> dst )
+	TrafficDirectionBi
+)
+
+const (
+	SrcUser SrcType = "user"
+	SrcHost SrcType = "host"
+
+	DstHost DstType = "host"
+)
+
+type Acl struct {
+	Src              SrcType                 `json:"src_type"`
+	Dst              DstType                 `json:"dst_type"`
+	AllowedDirection AllowedTrafficDirection `json:"allowed_traffic_direction"`
+}