notifications

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2017 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Hub = HubType{
	// contains filtered or unexported fields
}

Hub is a websocket hub

To send message do Hub.broadcast <- []byte("MESSAGE")

View Source
var Upgrader = websocket.Upgrader{}

Upgrader is used to upgrade requests to websocket requests

Functions

func GetNotifications

func GetNotifications() *[]Notification

GetNotifications will return all notifications currently saved in the database - returns nil on error

func NewNotification

func NewNotification(text, link string) error

NewNotification will push a websocket message to all

func WSHandler

func WSHandler(w http.ResponseWriter, r *http.Request)

WSHandler is the web socket handler

Types

type Client

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

Client is a websocket client

type HubType

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

HubType is the type for a websocket hub

func (*HubType) Start

func (hub *HubType) Start()

Start runs forever as a goroutine

type Notification

type Notification = config.Notification

Notification is a link to the underlying type of config.Notification

Jump to

Keyboard shortcuts

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