wemoweb

package
v0.0.0-...-a345be0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHttpAuth

func CheckHttpAuth(w http.ResponseWriter, r *http.Request) bool

func CheckUserPass

func CheckUserPass(user, pass string) bool

func Discover

func Discover(config Config_t) (map[string]map[string]string, error)

func DiscoverCli

func DiscoverCli(config Config_t)

func GenerateRootPage

func GenerateRootPage(w http.ResponseWriter, devices map[string]map[string]string, message string) error

func HttpLog

func HttpLog(r *http.Request, status int)

func ReadDevices

func ReadDevices(config Config_t) (map[string]map[string]string, error)

func ReadUsers

func ReadUsers() (map[string]string, error)

func StartHttp

func StartHttp(config Config_t)

func UpdateDevices

func UpdateDevices(config Config_t, deviceList, newDevices map[string]map[string]string) bool

func WriteDevices

func WriteDevices(config Config_t, deviceList map[string]map[string]string) error

Types

type Config_t

type Config_t struct {
	HttpPort         int    `json:"http_port"`
	EthDevice        string `json:"eth_device"`
	DevicesFile      string `json:"devices_file"`
	DiscoveryTimeout int    `json:"discovery_timeout"`
	HtmlTemplate     string `json:"html_tmpl"`
	UsersFile        string `json:"users_file"`
	UseTls           bool   `json:"use_tls"`
	TlsCertFile      string `json:"tls_cert_file"`
	TlsKeyFile       string `json:"tls_key_file"`
}

func ReadConfig

func ReadConfig() (Config_t, error)

Jump to

Keyboard shortcuts

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