Documentation ¶
Index ¶
Constants ¶
View Source
const ( IPv4 = IPType(4) IPv6 = IPType(6) )
View Source
const ( ProtoTCP = Protocol("tcp") ProtoUDP = Protocol("udp") ProtoAll = Protocol("all") )
View Source
const ( AddressNone = AddressType("") AddressSimple = AddressType("simple") AddressMask = AddressType("mask") AddressRange = AddressType("range") )
View Source
const ( RuleBlock = RuleType("block") RuleAllow = RuleType("allow") )
View Source
const (
AllPorts = "1:65535"
)
Variables ¶
View Source
var DryRun = false
Functions ¶
func Apply ¶
func Apply(rules []Rule, drops DropConfig) (err error)
Types ¶
type AddressType ¶
type AddressType string
type DropConfig ¶
type Rule ¶
type Rule struct { CreatedAt time.Time `json:"created_at"` TTL int `json:"ttl"` // used from the api to delete expired rules Type RuleType `json:"type"` // always RuleBlock for now Address string `json:"address"` AddressType AddressType `json:"address_type"` Protocol Protocol `json:"protocol"` Ports []string `json:"ports"` // strings to also allow ranges Comment string `json:"comment"` }
Click to show internal directories.
Click to hide internal directories.