Refactor stations discovery and add hostapd discovery

This commit is contained in:
nemunaire 2026-01-01 23:29:34 +07:00
commit 2922a03724
15 changed files with 1339 additions and 249 deletions

View file

@ -0,0 +1,24 @@
package station
import (
"fmt"
"github.com/nemunaire/repeater/internal/station/arp"
"github.com/nemunaire/repeater/internal/station/backend"
"github.com/nemunaire/repeater/internal/station/dhcp"
"github.com/nemunaire/repeater/internal/station/hostapd"
)
// createBackend creates a station backend based on the backend name
func createBackend(backendName string) (backend.StationBackend, error) {
switch backendName {
case "arp":
return arp.NewBackend(), nil
case "dhcp":
return dhcp.NewBackend(), nil
case "hostapd":
return hostapd.NewBackend(), nil
default:
return nil, fmt.Errorf("invalid station backend: %s (must be 'arp', 'dhcp', or 'hostapd')", backendName)
}
}