controller

package
v1.1.1-0...-6dff958 Latest Latest
Warning

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

Go to latest
Published: May 31, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package controller implements the handler interfaces to access the model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CharacteristicController

type CharacteristicController struct {
	// contains filtered or unexported fields
}

CharacteristicController implements the CharacteristicsHandler interface and provides read (GET) and write (POST) interfaces to the managed characteristics.

func NewCharacteristicController

func NewCharacteristicController(m *accessory.Container) *CharacteristicController

NewCharacteristicController returns a new characteristic controller.

func (*CharacteristicController) GetCharacteristic

func (ctr *CharacteristicController) GetCharacteristic(aid int64, iid int64) *characteristic.Characteristic

GetCharacteristic returns the characteristic identified by the accessory id aid and characteristic id iid

func (*CharacteristicController) HandleGetCharacteristics

func (ctr *CharacteristicController) HandleGetCharacteristics(form url.Values, conn net.Conn) (io.Reader, error)

HandleGetCharacteristics handles a get characteristic request like `/characteristics?id=1.4,1.5`

func (*CharacteristicController) HandleUpdateCharacteristics

func (ctr *CharacteristicController) HandleUpdateCharacteristics(r io.Reader, conn net.Conn) error

HandleUpdateCharacteristics handles an update characteristic request. The bytes must represent a data.Characteristics json.

type ContainerController

type ContainerController struct {
	// contains filtered or unexported fields
}

ContainerController implements the AccessoriesHandler interface.

func NewContainerController

func NewContainerController(m *accessory.Container) *ContainerController

NewContainerController returns a controller for the argument container.

func (*ContainerController) HandleGetAccessories

func (ctr *ContainerController) HandleGetAccessories(r io.Reader) (io.Reader, error)

HandleGetAccessories returns the container as json bytes.

func (*ContainerController) IdentifyAccessory

func (ctr *ContainerController) IdentifyAccessory()

IdentifyAccessory calls Identify() for all accessories.

Jump to

Keyboard shortcuts

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