Documentation
¶
Index ¶
- Variables
- func ConnectHandler(w http.ResponseWriter, r *http.Request)
- func DisconnectHandler(w http.ResponseWriter, r *http.Request)
- func Errorf(format string, a ...interface{}) error
- func HashItHandler(w http.ResponseWriter, r *http.Request)
- func ManagementHandler(w http.ResponseWriter, r *http.Request)
- func OperationalHandler(w http.ResponseWriter, r *http.Request)
- func ShutdownManagementServer() error
- func ShutdownOperationalServer() error
- func Sprintf(format string, a ...interface{}) string
- func StartManagementServer() error
- func StartOperationalServer() error
- func WaitForState(state RunningState) bool
- type ConnectingData
- type Data
- type RunningState
- type Server
- type SsidsData
Constants ¶
This section is empty.
Variables ¶
var Current = None
Current active server instance. None if any is enabled at this moment
var ResourcesPath = filepath.Join(os.Getenv("SNAP"), "static")
ResourcesPath absolute path to web static resources
var State = Stopped
State holds current server state
Functions ¶
func ConnectHandler ¶
func ConnectHandler(w http.ResponseWriter, r *http.Request)
ConnectHandler reads form got ssid and password and tries to connect to that network
func DisconnectHandler ¶
func DisconnectHandler(w http.ResponseWriter, r *http.Request)
DisconnectHandler allows user to disconnect from external AP
func Errorf ¶
Errorf returns a new instance implementing error interface taken a formatted string and params as input
func HashItHandler ¶
func HashItHandler(w http.ResponseWriter, r *http.Request)
HashItHandler returns a hash of the password as json
func ManagementHandler ¶
func ManagementHandler(w http.ResponseWriter, r *http.Request)
ManagementHandler lists the current available SSIDs
func OperationalHandler ¶
func OperationalHandler(w http.ResponseWriter, r *http.Request)
OperationalHandler display Opertational mode page
func ShutdownManagementServer ¶
func ShutdownManagementServer() error
ShutdownManagementServer shutdown server management mode. If management server is not up, returns error
func ShutdownOperationalServer ¶
func ShutdownOperationalServer() error
ShutdownOperationalServer shutdown server operational mode. If operational server is not up, returns error
func StartManagementServer ¶
func StartManagementServer() error
StartManagementServer starts server in management mode
func StartOperationalServer ¶
func StartOperationalServer() error
StartOperationalServer starts server in operational mode
func WaitForState ¶
func WaitForState(state RunningState) bool
WaitForState waits for server reach certain state
Types ¶
type ConnectingData ¶
type ConnectingData struct {
Ssid string
}
ConnectingData dynamic data to fulfill the connect result page template
type RunningState ¶
type RunningState int
RunningState enum defining which server is up and running
const ( Stopped RunningState = 0 + iota Starting Running Stopping )
Server running state