sse

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeadersMiddleware

func HeadersMiddleware() gin.HandlerFunc

Types

type Broker

type Broker struct {
	// Events are pushed to this channel by the main events-gathering routine
	Events chan Event

	// New client connections
	NewClients chan chan Event

	// Closed client connections
	ClosedClients chan chan Event

	// Total client connections
	TotalClients map[chan Event]bool
}

func NewBroker

func NewBroker() (broker *Broker)

Initialize event and Start procnteessing requests

func (*Broker) ServeHTTP

func (stream *Broker) ServeHTTP() gin.HandlerFunc

type ClientChan

type ClientChan chan Event

New event messages are broadcast to all registered client connection channels

type Event

type Event struct {
	Channel string
	Content interface{}
}

type Publisher

type Publisher interface {
	PublishEvent(event Event)
}

Jump to

Keyboard shortcuts

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