package
1.2.5
Repository: https://github.com/brutella/hc.git
Documentation: pkg.go.dev

# Packages

Package data provides structs to map json to objects.
Package endpoint implements the HAP endpoints.
Package http implements a http-like hap server to handle requests and responses.
Package pair implements the pairing and verification protocol.

# Functions

Body returns the json body for an notification response as bytes.
FixProtocolSpecifier returns bytes where the http protocol specifier "HTTP/1.0" is replaced by "EVENT/1.0" in the argument bytes.
NewCharacteristicNotification returns an notification response for a characteristic from an accessory.
NewChunkedWriter returns a writer which writes bytes in chunkes of specified size.
NewConnection returns a hap connection.
NewContextForSecuredDevice returns a new Context.
NewDevice returns a client for a specific name either loaded from the database or newly created.
NewKeepAlive returns a new keep alive for a specific timeout.
NewNotification returns a notification response with a specific body content.
NewSecuredDevice returns a device for a specific name either loaded from the database or newly created.
NewSession returns a session for a connection.

# Constants

HTTPContentTypeHAPJson is the HTTP content type for json data.
HTTPContentTypePairingTLV8 is the HTTP content type for pairing.
MethodDEL is the HTTP Delete method.
MethodGET is the HTTP Get method.
MethodPOST is the HTTP Post method.
MethodPUT is the HTTP Put method.

# Structs

Connection is a connection based on HAP protocol which encrypts and decrypts the data.
KeepAlive encapsulates sending notifications with no content to all connected clients.

# Interfaces

A ContainerHandler abstracts request/response communication.
Context holds objects which are shared between the different parts of the system.
Device is a HomeKit device with a name, private and public key.
A PairVerifyHandler is a ContainerHandler which negotations a shared key.
SecuredDevice is a HomeKit device with a pin.
Session contains objects (encrypter, decrypter, pairing handler,...) used to handle the data communication.
Store provides a key-value in-memory storage.