subscriber

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subscriber

type Subscriber struct {
	Username string
	Password string
	BaseURL  string
	Channel  string
	Metrics  *statsd.Client
}

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

func (*Subscriber) Subscribe

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

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

type WireguardEvent

type WireguardEvent struct {
	Action string            `json:"action"`
	Peer   api.WireguardPeer `json:"peer"`
}

WireguardEvent is a wireguard key event

Jump to

Keyboard shortcuts

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