controllers

package
v0.0.0-...-b1a8189 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package baseController implements boilerplate code for all baseControllers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateDeviceTwinWithDesiredTrack

func UpdateDeviceTwinWithDesiredTrack(track string) bool

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

func (*TrackController) PlayTrack

func (controller *TrackController) PlayTrack()

PlayTrack

func (*TrackController) StopTrack

func (controller *TrackController) StopTrack()

StopTrack

Jump to

Keyboard shortcuts

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