network

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSProxy

type DNSProxy struct {
	// contains filtered or unexported fields
}

DNSProxy handles DNS requests for bare hostname access

func NewDNSProxy

func NewDNSProxy() *DNSProxy

NewDNSProxy creates a new DNSProxy

func (*DNSProxy) ServeDNS

func (d *DNSProxy) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

ServeDNS implements the dns.Handler interface

func (*DNSProxy) Start

func (d *DNSProxy) Start(cfg model.HostnameConfig) error

Start starts the DNS proxy

func (*DNSProxy) Stop

func (d *DNSProxy) Stop()

Stop stops the DNS proxy

type LinuxAdapter

type LinuxAdapter struct{}

func NewLinuxAdapter

func NewLinuxAdapter() *LinuxAdapter

func (*LinuxAdapter) ApplyInterfaceConfig

func (a *LinuxAdapter) ApplyInterfaceConfig(iface model.NetworkInterface) error

func (*LinuxAdapter) ApplyStaticRoute

func (a *LinuxAdapter) ApplyStaticRoute(route model.StaticRoute) error

func (*LinuxAdapter) GetInterfaces

func (a *LinuxAdapter) GetInterfaces() ([]model.NetworkInterface, error)

func (*LinuxAdapter) GetRoutes

func (a *LinuxAdapter) GetRoutes() ([]model.StaticRoute, error)

func (*LinuxAdapter) ValidateConnectivity

func (a *LinuxAdapter) ValidateConnectivity(targets []model.ConnectivityTarget) (model.ConnectivityReport, error)

type MDNSServer

type MDNSServer struct {
	// contains filtered or unexported fields
}

MDNSServer manages mDNS services

func NewMDNSServer

func NewMDNSServer() *MDNSServer

NewMDNSServer creates a new MDNSServer

func (*MDNSServer) Start

func (s *MDNSServer) Start(cfg model.HostnameConfig) error

Start starts the mDNS services based on configuration

func (*MDNSServer) Stop

func (s *MDNSServer) Stop()

Stop stops all mDNS services

type NetworkAdapter

type NetworkAdapter interface {
	ApplyInterfaceConfig(iface model.NetworkInterface) error
	ApplyStaticRoute(route model.StaticRoute) error
	GetInterfaces() ([]model.NetworkInterface, error)
	GetRoutes() ([]model.StaticRoute, error)
	ValidateConnectivity(targets []model.ConnectivityTarget) (model.ConnectivityReport, error)
}

NetworkAdapter defines the interface for OS-specific network operations

func NewNetworkAdapter

func NewNetworkAdapter() NetworkAdapter

NewNetworkAdapter creates a platform-specific network adapter

type NetworkManager

type NetworkManager struct {
	// contains filtered or unexported fields
}

NetworkManager manages network configurations and operations

func NewNetworkManager

func NewNetworkManager() *NetworkManager

NewNetworkManager creates a new NetworkManager

func (*NetworkManager) ApplyConfig

func (nm *NetworkManager) ApplyConfig(interfaces []model.NetworkInterface, routes []model.StaticRoute) error

ApplyConfig applies the given network configuration

func (*NetworkManager) ApplyConfigWithTransaction

func (nm *NetworkManager) ApplyConfigWithTransaction(interfaces []model.NetworkInterface, routes []model.StaticRoute, validationTargets []model.ConnectivityTarget) error

ApplyConfigWithTransaction applies the given network configuration with transaction support (rollback on failure)

func (*NetworkManager) GetInterfaces

func (nm *NetworkManager) GetInterfaces() ([]model.NetworkInterface, error)

GetInterfaces returns the current status of all interfaces

func (*NetworkManager) GetRoutes

func (nm *NetworkManager) GetRoutes() ([]model.StaticRoute, error)

GetRoutes returns the current static routes

type WindowsAdapter

type WindowsAdapter struct{}

WindowsAdapter implements NetworkAdapter for Windows

func (*WindowsAdapter) ApplyInterfaceConfig

func (a *WindowsAdapter) ApplyInterfaceConfig(iface model.NetworkInterface) error

func (*WindowsAdapter) ApplyStaticRoute

func (a *WindowsAdapter) ApplyStaticRoute(route model.StaticRoute) error

func (*WindowsAdapter) GetInterfaces

func (a *WindowsAdapter) GetInterfaces() ([]model.NetworkInterface, error)

func (*WindowsAdapter) GetRoutes

func (a *WindowsAdapter) GetRoutes() ([]model.StaticRoute, error)

func (*WindowsAdapter) ValidateConnectivity

func (a *WindowsAdapter) ValidateConnectivity(targets []model.ConnectivityTarget) (model.ConnectivityReport, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL