sse

package
v0.2.35 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubscribeHandler

func SubscribeHandler(br *Broker, validator Validator, processor Processor) http.Handler

Types

type Broker

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

func NewBroker

func NewBroker() *Broker

func (*Broker) Start

func (br *Broker) Start()

type Connection

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

func NewConnection

func NewConnection(response http.ResponseWriter, request *http.Request, namespace string) *Connection

func (*Connection) BroadcastMessage

func (conn *Connection) BroadcastMessage(receive <-chan int)

type Processor

type Processor func(r *http.Request, receive <-chan int, send chan<- int)

type SSE

type SSE struct {
	Broker          *Broker
	OutboundChannel chan<- SSEMessage
}

func NewSSE

func NewSSE() *SSE

type SSEMessage

type SSEMessage struct {
	Event     string
	Data      []byte
	Namespace string
}

type Validator

type Validator func(r *http.Request) (string, error)

Jump to

Keyboard shortcuts

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