eventsource

package
v0.0.0-...-967dab9 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package eventsource provides HTTP/1.1 and HTTP/2 support for server-side events.

Based on: https://gist.github.com/schmohlio/d7bdb255ba61d3f5e51a512a7c0d6a85 https://gist.github.com/ismasan/3fb75381cd2deb6bfa9c https://github.com/antage/eventsource

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	log.FieldLogger
	// contains filtered or unexported fields
}

func New

func New() *Broker

func (*Broker) Notify

func (broker *Broker) Notify(m *Message)

func (*Broker) ServeHTTP

func (broker *Broker) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type Message

type Message struct {
	ID    string
	Event string
	Data  string
}

func (*Message) String

func (m *Message) String() string

Jump to

Keyboard shortcuts

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