package platform

// NetworkInfo holds discovered local network configuration from the
// system's default-route network adapter.
type NetworkInfo struct {
	DNSServers []string // Ordered DNS server IPs from the default-route adapter
	Gateway    string   // Default gateway IP (may be empty if not discoverable)
	Interface  string   // Adapter name holding the default route (informational)
}

// NetworkDiscoverer discovers the local network configuration.
type NetworkDiscoverer interface {
	Discover() (NetworkInfo, error)
}

// FakeNetworkDiscoverer returns predetermined NetworkInfo for testing.
// It is exported so packages outside of platform can use it in tests.
type FakeNetworkDiscoverer struct {
	Info NetworkInfo
	Err  error
}

// Discover implements NetworkDiscoverer. Returns the pre-configured Info and Err.
func (f *FakeNetworkDiscoverer) Discover() (NetworkInfo, error) {
	return f.Info, f.Err
}
