sse

package
v0.0.0-...-9a8ef1a Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(router *mux.Router, path string, group *Group)

Registers an SSE stream with the given router and Group.

Types

type Group

type Group struct {
	Name     string
	Mutex    sync.Mutex
	Channels map[chan interface{}]bool
}

func NewGroup

func NewGroup(name string) *Group

func (*Group) Publish

func (g *Group) Publish(event interface{})

Publishs an event to the feed.

func (*Group) Register

func (g *Group) Register() chan interface{}

Registers a new client to the feed.

func (*Group) Unregister

func (g *Group) Unregister(ch chan interface{})

Unregisters a client from the feed. As a side effect the clients channel gets closed.

Jump to

Keyboard shortcuts

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