portal

package
v0.0.0-...-d2bd7e9 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port        string `yaml:"port" json:"port"`
	Interface   string `yaml:"interface" json:"interface"`       // WiFi interface to manage
	SSID        string `yaml:"ssid" json:"ssid"`                 // SSID of the AP hosting this portal
	Gateway     string `yaml:"gateway" json:"gateway"`           // Gateway IP of the AP
	RedirectURL string `yaml:"redirect_url" json:"redirect_url"` // Optional redirect after setup
}

Config represents the configuration for the WiFi setup portal server

type Server

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

Server represents the WiFi setup portal HTTP server

func NewServer

func NewServer(config Config) *Server

NewServer creates a new WiFi setup portal server

func (*Server) AddRoute

func (s *Server) AddRoute(path string, handler http.HandlerFunc) *mux.Route

AddRoute adds a custom route to the server

func (*Server) AddRoutes

func (s *Server) AddRoutes(setupFunc func(*mux.Router))

AddRoutes allows external packages to register multiple routes

func (*Server) Router

func (s *Server) Router() *mux.Router

Router returns the underlying mux router for custom route registration

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts the HTTP server

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop gracefully stops the HTTP server

Jump to

Keyboard shortcuts

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