endpoint

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: Apache-2.0 Imports: 15 Imported by: 5

Documentation

Overview

Package endpoint implements the HAP endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetImageFunc added in v1.1.0

type GetImageFunc func(width, height uint) (*image.Image, error)

type ImageRequest added in v1.1.0

type ImageRequest struct {
	Type   string `json:"resource-type"`
	Width  uint   `json:"image-width"`
	Height uint   `json:"image-height"`
}

type PairSetup

type PairSetup struct {
	http.Handler
	// contains filtered or unexported fields
}

PairSetup handles the /pair-setup endpoint and returns TLV8 encoded data.

This endoint is session based and handles requests based on their connections. Which means that there is one pair setup controller for every connection. This is required to support simultaneous pairing connections.

When pairing finished, the DevicePaired event is sent using an event emitter.

func NewPairSetup

func NewPairSetup(context hap.Context, device hap.SecuredDevice, database db.Database, emitter event.Emitter) *PairSetup

NewPairSetup returns a new handler for pairing endpoint

func (*PairSetup) ServeHTTP

func (endpoint *PairSetup) ServeHTTP(response http.ResponseWriter, request *http.Request)

type PairVerify

type PairVerify struct {
	http.Handler
	// contains filtered or unexported fields
}

PairVerify handles the /pair-verify endpoint and returns TLV8 encoded data

This endoint is session based and handles requests based on their connections. Which means that there is one pair verify controller for every connection. This is required to support simultaneous verification connections.

func NewPairVerify

func NewPairVerify(context hap.Context, database db.Database) *PairVerify

NewPairVerify returns a new endpoint for pair verify endpoint

func (*PairVerify) ServeHTTP

func (endpoint *PairVerify) ServeHTTP(response http.ResponseWriter, request *http.Request)

type Pairing

type Pairing struct {
	http.Handler
	// contains filtered or unexported fields
}

Pairing handles the /pairings endpoint.

This endpoint is not session based and the same for all connections.

func NewPairing

func NewPairing(controller *pair.PairingController, emitter event.Emitter) *Pairing

NewPairing returns a new handler for pairing enpdoint

func (*Pairing) ServeHTTP

func (endpoint *Pairing) ServeHTTP(response http.ResponseWriter, request *http.Request)

type Resource added in v1.1.0

type Resource struct {
	http.Handler
	// contains filtered or unexported fields
}

Resource handles the /resource endpoint

func NewResource added in v1.1.0

func NewResource(context hap.Context, imgFn GetImageFunc) *Resource

NewResource returns a new handler for resource requests

func (*Resource) ServeHTTP added in v1.1.0

func (handler *Resource) ServeHTTP(response http.ResponseWriter, request *http.Request)

Jump to

Keyboard shortcuts

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