http

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Overview

Package http implements a http-like hap server to handle requests and responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(c Config) *server

NewServer returns a server

Types

type Config

type Config struct {
	Port      string
	Context   hap.Context
	Database  db.Database
	Container *accessory.Container
	Device    hap.SecuredDevice
	Mutex     *sync.Mutex
	Emitter   event.Emitter
}

type Server

type Server interface {
	// ListenAndServe start the server
	ListenAndServe(context.Context) error

	// Port returns the port on which the server listens to
	Port() string
}

Server provides a similar interfaces as http.Server to start and stop a TCP server.

Jump to

Keyboard shortcuts

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