Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NetworkLocker ¶
type NetworkLocker interface {
Backend() NetworkLockerBackend
Lock(ports []uint16) error
Unlock(ports []uint16) error
}
func NewNetworkLocker ¶
func NewNetworkLocker(netNS ns.NetNS) NetworkLocker
NewNetworkLocker returns a new network locker with the implementation depending on OS support. If supported it will return an nftables based locker with a fallback to iptables.
type NetworkLockerBackend ¶
type NetworkLockerBackend string
const ( NetworkLockerNFTables NetworkLockerBackend = "nftables" NetworkLockerIPTables NetworkLockerBackend = "iptables" )
Click to show internal directories.
Click to hide internal directories.