Documentation ¶
Overview ¶
Package baseController implements boilerplate code for all baseControllers.
Index ¶
- func UpdateDeviceTwinWithDesiredTrack(track string) bool
- type BaseController
- func (baseController *BaseController) AjaxResponse(resultCode int, resultString string, data interface{})
- func (baseController *BaseController) CatchPanic(functionName string)
- func (baseController *BaseController) ParseAndValidate(params interface{}) bool
- func (baseController *BaseController) ServeError(err error)
- func (baseController *BaseController) ServeValidationErrors(Errors []string)
- type DeviceStatus
- type TrackController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateDeviceTwinWithDesiredTrack ¶
UpdateDeviceTwinWithDesiredTrack patches the desired state of the device twin with the track to play.
Types ¶
type BaseController ¶
type BaseController struct {
beego.Controller
}
func (*BaseController) AjaxResponse ¶
func (baseController *BaseController) AjaxResponse(resultCode int, resultString string, data interface{})
AjaxResponse returns a standard ajax response.
func (*BaseController) CatchPanic ¶
func (baseController *BaseController) CatchPanic(functionName string)
CatchPanic is used to catch any Panic and log exceptions. Returns a 500 as the response.
func (*BaseController) ParseAndValidate ¶
func (baseController *BaseController) ParseAndValidate(params interface{}) bool
ParseAndValidate will run the params through the validation framework and then response with the specified localized or provided message.
func (*BaseController) ServeError ¶
func (baseController *BaseController) ServeError(err error)
ServeError prepares and serves an Error exception.
func (*BaseController) ServeValidationErrors ¶
func (baseController *BaseController) ServeValidationErrors(Errors []string)
ServeValidationErrors prepares and serves a validation exception.
type DeviceStatus ¶
type DeviceStatus struct {
Status v1alpha1.DeviceStatus `json:"status"`
}
DeviceStatus is used to patch device status
type TrackController ¶
type TrackController struct {
BaseController
}
func (*TrackController) Index ¶
func (controller *TrackController) Index()
Index is the initial view
Click to show internal directories.
Click to hide internal directories.