webserver

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package webserver provides all the methods for our web server. There aren't very many things going on here yet, and it will likely get split into more packages as it gets built out. Right now, it basically has an event handler that allows external home automation tools to trigger event notifications. It also provides a nice API to send iMessages. You can use this to program in your home automation apps to "curl" an interface to send a msg to an iPhone, etc. We also have hooks for SecuritySpy, to capture and send videos or pictures to messenger users. This code needs a re-think now that we have an event stream.

Index

Constants

View Source
const (
	DefaultListenPort = 8765
	Timeout           = 30 * time.Second
)

Variables

This section is empty.

Functions

func Start

func Start(c *Config) error

Start validates the config and returns any errors. If all goes well, this will not return until the server shuts down.

Types

type Config

type Config struct {
	SSpy      *securityspy.Server
	Subs      *subscribe.Subscribe
	Msgs      *messenger.Messenger
	Info      *log.Logger
	Debug     *log.Logger
	Error     *log.Logger
	TempDir   string
	AllowedTo []string
	Port      uint
	// contains filtered or unexported fields
}

func (*Config) Start added in v0.0.6

func (c *Config) Start()

StartWebServer creates the http routers and starts http server This code block shows all the routes, for now.

func (*Config) Stop

func (c *Config) Stop() error

Stop shuts down the HTTP listener.

Jump to

Keyboard shortcuts

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