server

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPIHandler

func NewAPIHandler(tunnelHandler *TunnelHandler, notifier *Notifier) http.Handler

NewAPIHandler creates http handler of secure tunnel API.

Types

type Notifier

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

Notifier is a token notifier.

func NewNotifier

func NewNotifier(cli mqtt.Client, opts ...NotifierOption) *Notifier

NewNotifier creates token notifier via MQTT.

type NotifierOption

type NotifierOption func(*Notifier)

NotifierOption is a functional option of Notifier.

func WithNotifyTopicFormat

func WithNotifyTopicFormat(format string) NotifierOption

WithNotifyTopicFormat sets notify topic format. %s will be replaced by thing name.

type TunnelHandler

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

TunnelHandler handles websocket based secure tunneling sessions.

func NewTunnelHandler

func NewTunnelHandler() *TunnelHandler

NewTunnelHandler creates tunnel WebSocket handler.

func (*TunnelHandler) ServeHTTP

func (h *TunnelHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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