Documentation
¶
Overview ¶
Package networkpolicy stores Solomon's network selection independently of OS configuration.
Index ¶
- func AllowedLocal(ip net.IP) bool
- func ApplyTailscaleStatus(rows []Interface, data []byte)
- func DialContext(ctx context.Context, network, address string) (net.Conn, error)
- func InterfaceType(name string, local bool) string
- func LinuxInterfaceType(root, name string) string
- func PolicyPath() (string, error)
- func RunningInContainer(readFile func(string) ([]byte, error)) bool
- func Set(name string, enabled bool) error
- func SetOutbound(name string) error
- func WrapDial(fallback func(context.Context, string, string) (net.Conn, error), ...) func(context.Context, string, string) (net.Conn, error)
- func WritePolicyFile(path string, p Policy) error
- type Interface
- type Policy
- type TailscaleInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowedLocal ¶
AllowedLocal checks the destination address accepted by the server.
func ApplyTailscaleStatus ¶
func InterfaceType ¶
func LinuxInterfaceType ¶
func PolicyPath ¶
func SetOutbound ¶ added in v2026.1121.0
func WrapDial ¶
func WrapDial(fallback func(context.Context, string, string) (net.Conn, error), timeout ...time.Duration) func(context.Context, string, string) (net.Conn, error)
WrapDial preserves the caller timeout and custom dial behavior when unrestricted.
func WritePolicyFile ¶
Types ¶
type Interface ¶
type Interface struct {
Tailscale *TailscaleInfo `json:"tailscale,omitempty"`
Type string `json:"type"`
DisplayLabel string `json:"display_name"`
Number int `json:"number"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Up bool `json:"up"`
Local bool `json:"local"`
Addresses []string `json:"addresses"`
}
func ListUnfiltered ¶
func VisibleInterfaces ¶
Filter the user-facing list only; hiding an interface must not alter routing or server access through Docker bridges.
func (Interface) DisplayName ¶
DisplayName keeps the actual interface name when its type cannot be established.
type Policy ¶
type Policy struct {
OutboundInterface string `json:"outbound_interface,omitempty"`
Disabled map[string]bool `json:"disabled"`
DisabledMagicDNS map[string]bool `json:"disabled_magic_dns,omitempty"`
}
func (Policy) AllowedHostname ¶
AllowedHostname controls Solomon access via the saved MagicDNS aliases.