subscriber

package
v0.0.0-...-0a150ed Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(s *Subscriber)

func WithBasicAuth

func WithBasicAuth(username, password string) Option

func WithHeader

func WithHeader(key, val string) Option

type Subscriber

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

Subscriber is a utility for receiving wireguard key events from a message-queue server

func New

func New(url string, options ...Option) *Subscriber

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(ctx context.Context, channel chan<- models.DeviceEvent) error

Subscribe establishes a websocket connection for a message-queue channel, and emits messages on the given channel

Jump to

Keyboard shortcuts

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