Files
gluetun/internal/netlink/family.go
Quentin McGaw d6924597dd chore(netlink): separate linux only and OS independent code
- Move `Addr` and its `String` method to `types.go`
- Move `IsWireguardSupported` to `wireguard.go` to have `family.go` OS independant
- Remove dependency on vishvananda/netlink in `ipv6.go`
- Move `Link` to `types.go`
- Move `Route` to `types.go`
- Move `Rule` and its `String` method to `types.go`
2023-05-29 06:56:55 +00:00

25 lines
303 B
Go

package netlink
import (
"fmt"
)
const (
FamilyAll = 0
FamilyV4 = 2
FamilyV6 = 10
)
func FamilyToString(family int) string {
switch family {
case FamilyAll:
return "all" //nolint:goconst
case FamilyV4:
return "v4"
case FamilyV6:
return "v6"
default:
return fmt.Sprint(family)
}
}