netmaker/models/acl.go
2024-09-23 16:09:59 +04:00

27 lines
707 B
Go

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"`
}