api

package
v1.0.142 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BuildVersion contains the version information for the app
	BuildVersion = "Unknown"

	// CommitID is the git commitId for the app.  It's filled in as
	// part of the automated build
	CommitID string

	// ApplicationStartTime is the start time of the app
	ApplicationStartTime = time.Now()
)

Functions

func GetActivityInRange added in v1.0.42

func GetActivityInRange(rw http.ResponseWriter, req *http.Request)

GetActivityInRange gets activity for the appliance for a given time range

func GetAllActivity added in v1.0.42

func GetAllActivity(rw http.ResponseWriter, req *http.Request)

GetAllActivity gets activity for the appliance for a given time range

func ShowUI added in v1.0.60

func ShowUI(rw http.ResponseWriter, req *http.Request)

ShowUI redirects to the /ui/ url path

Types

type ActivityRequest added in v1.0.35

type ActivityRequest struct {
	StartTime string `json:"starttime"`
	EndTime   string `json:"endtime"`
}

ActivityRequest represents an API request for activity

type ConfigAPI added in v1.0.80

type ConfigAPI struct {

	// Updated signals when the configuration has been updated
	Updated chan bool
}

ConfigAPI represents the configuration API routes

func (*ConfigAPI) GetAllConfig added in v1.0.80

func (c *ConfigAPI) GetAllConfig(rw http.ResponseWriter, req *http.Request)

GetAllConfig gets all configuration and returns it in JSON format.

func (*ConfigAPI) GetConfigItem added in v1.0.80

func (c *ConfigAPI) GetConfigItem(rw http.ResponseWriter, req *http.Request)

GetConfigItem gets a single configuration and returns it in JSON format. If the item can't be found, returns an empty config item

func (*ConfigAPI) RemoveConfigItem added in v1.0.80

func (c *ConfigAPI) RemoveConfigItem(rw http.ResponseWriter, req *http.Request)

RemoveConfigItem removes a single config item

func (*ConfigAPI) SetAllConfigItems added in v1.0.80

func (c *ConfigAPI) SetAllConfigItems(rw http.ResponseWriter, req *http.Request)

SetAllConfigItems adds or updates multiple config items and returns all config items in JSON format

func (*ConfigAPI) SetConfigItem added in v1.0.80

func (c *ConfigAPI) SetConfigItem(rw http.ResponseWriter, req *http.Request)

SetConfigItem adds or updates a single config item and returns the new item in JSON format

type CurrentState added in v1.0.35

type CurrentState struct {
	ServerStartTime    time.Time `json:"starttime"`
	ApplicationVersion string    `json:"appversion"`
	DeviceRunning      bool      `json:"devicerunning"`
	DeviceID           string    `json:"deviceId"`
}

CurrentState describes the current running state of the application

type ErrorResponse added in v1.0.35

type ErrorResponse struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

ErrorResponse represents an API response

type Hub added in v1.0.58

type Hub struct {

	// Inbound messages from the connections.
	Broadcast chan []byte
	// contains filtered or unexported fields
}

Hub is used to manage and coordinate websocket connections

func NewHub added in v1.0.58

func NewHub() *Hub

NewHub creates a new hub object

type SystemAPI added in v1.0.99

type SystemAPI struct {
	// Reboot signals when the machine should be rebooted
	Reboot chan bool
}

SystemAPI represents the system API routes

func (*SystemAPI) GetCurrentState added in v1.0.99

func (s *SystemAPI) GetCurrentState(rw http.ResponseWriter, req *http.Request)

GetCurrentState gets the current running state of the application

func (*SystemAPI) UpdateWifi added in v1.0.99

func (s *SystemAPI) UpdateWifi(rw http.ResponseWriter, req *http.Request)

UpdateWifi updates the wifi credentials for the machine

type WifiUpdateRequest added in v1.0.93

type WifiUpdateRequest struct {
	SSID       string `json:"ssid"`
	Passphrase string `json:"passphrase"`
}

WifiUpdateRequest describes the request to update the Wifi credentials

type WifiUpdateResponse added in v1.0.93

type WifiUpdateResponse struct {
	Status      int    `json:"status"`
	Description string `json:"description"`
}

WifiUpdateResponse describes the response to update the Wifi credentials

type WsHandler added in v1.0.58

type WsHandler struct {
	H *Hub
}

func (WsHandler) ServeHTTP added in v1.0.58

func (wsh WsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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