webserver

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AboutHandler

func AboutHandler(w http.ResponseWriter, r *http.Request, conf *goconfig.Config)

AboutHandler shows the currently installed packages on the device.

func AboutHandlerGen

func AboutHandlerGen(conf *goconfig.Config) func(http.ResponseWriter, *http.Request)

AboutHandlerGen is a wrapper for the AboutHandler function.

func AdvancedMenuHandler

func AdvancedMenuHandler(w http.ResponseWriter, r *http.Request)

AdvancedMenuHandler is a screen to more advanced settings.

func CheckInterfaceHandler

func CheckInterfaceHandler(w http.ResponseWriter, r *http.Request)

CheckInterfaceHandler checks an interface to see if it is up or down. To do this the ping command is used to send data to Cloudfare at 1.1.1.1

func DiskMemoryHandler

func DiskMemoryHandler(w http.ResponseWriter, r *http.Request)

DiskMemoryHandler shows disk space usage and memory usage

func GenLocationHandler

func GenLocationHandler(config *goconfig.Config) func(w http.ResponseWriter, r *http.Request)

func GetRaspberryPiSerialNumber added in v1.0.1

func GetRaspberryPiSerialNumber() string

Return the serial number for the Raspberr Pi in the device.

func GetSaltMinionID added in v1.0.1

func GetSaltMinionID() string

Return the salt minion ID for the device.

func HeaderInfo

func HeaderInfo() *headers.HeaderInfo

func IndexHandler

func IndexHandler(w http.ResponseWriter, r *http.Request)

IndexHandler is the root handler.

func LastFrame

func LastFrame() *cptvframe.Frame

func LocationHandler

func LocationHandler(config *goconfig.Config, w http.ResponseWriter, r *http.Request)

LocationHandler shows and updates the location of the device.

func NetworkHandler

func NetworkHandler(w http.ResponseWriter, r *http.Request)

NetworkHandler - Show the status of each network interface

func RecordHandler added in v0.5.0

func RecordHandler(w http.ResponseWriter, r *http.Request)

RecordHandler will show a frame from the camera to help with positioning

func RecordStatusHandler added in v0.5.0

func RecordStatusHandler(w http.ResponseWriter, r *http.Request)

func Rename

func Rename(w http.ResponseWriter, r *http.Request)

Rename page to change device name and group

func Run

func Run() error

func SetHeadInfo

func SetHeadInfo(headerInfo *headers.HeaderInfo)

func SetLastFrame

func SetLastFrame(frame *cptvframe.Frame)

func SetProcessor added in v0.5.0

func SetProcessor(p *motion.MotionProcessor)

func TimeHandler

func TimeHandler(w http.ResponseWriter, r *http.Request)

func WebsocketServer added in v0.2.0

func WebsocketServer(ws *websocket.Conn)

func WifiNetworkHandler

func WifiNetworkHandler(w http.ResponseWriter, r *http.Request)

WifiNetworkHandler show the wireless networks listed in the wpa_supplicant configuration

Types

type Config

type Config struct {
	Port    int
	CPTVDir string
	// contains filtered or unexported fields
}

Config for management interface

func ParseConfig

func ParseConfig(configDir string) (*Config, error)

ParseConfig parses the config

func (Config) String

func (c Config) String() string

type FrameInfo added in v0.2.0

type FrameInfo struct {
	Camera        *headers.HeaderInfo
	Telemetry     cptvframe.Telemetry
	Calibration   map[string]interface{}
	BinaryVersion string
	AppVersion    string
	Mode          string
}

type WebsocketRegistration added in v0.2.0

type WebsocketRegistration struct {
	AtomicLock      uint32
	Socket          *websocket.Conn
	LastHeartbeatAt time.Time
}

func (*WebsocketRegistration) Inactive added in v0.5.0

func (socket *WebsocketRegistration) Inactive() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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