sackci: github.com/faryon93/sackci/sse Index | Files

package sse

import "github.com/faryon93/sackci/sse"

Index

Package Files

group.go sse.go

func Register Uses

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

Registers an SSE stream with the given router and Group.

type Group Uses

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

func NewGroup Uses

func NewGroup(name string) *Group

func (*Group) Publish Uses

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

Publishs an event to the feed.

func (*Group) Register Uses

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

Registers a new client to the feed.

func (*Group) Unregister Uses

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

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

Package sse imports 7 packages (graph) and is imported by 2 packages. Updated 2020-01-22. Refresh now. Tools for package owners.