Files
gluetun/internal/netlink/netlink.go
T

26 lines
484 B
Go

package netlink
import (
"github.com/qdm12/gluetun/internal/mod"
"github.com/qdm12/log"
)
type NetLink struct {
debugLogger DebugLogger
// Fixed state
conntrackNetlink bool
}
func New(debugLogger DebugLogger) *NetLink {
conntrackNetlink := mod.Probe("nf_conntrack_netlink") == nil
return &NetLink{
debugLogger: debugLogger,
conntrackNetlink: conntrackNetlink,
}
}
func (n *NetLink) PatchLoggerLevel(level log.Level) {
n.debugLogger.Patch(log.SetLevel(level))
}