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)
Click to show internal directories.
Click to hide internal directories.