sse

package
v0.0.0-...-1aed651 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ContentType = "text/event-stream"

Variables

View Source
var EOFMessage = NewMessage("", "error", "eof")
View Source
var NewEventStreamReader = sse.NewEventStreamReader

Functions

func NewRequest

func NewRequest(uri string) (*http.Request, error)

func Wrap

Types

type Message

type Message struct {
	ID    string
	Event string
	Data  string
}

func NewErrMessage

func NewErrMessage(id, data string) *Message

func NewMessage

func NewMessage(id, event, data string) *Message

func TransferMessage

func TransferMessage(content []byte) (*Message, error)

func (*Message) Send

func (m *Message) Send(w http.ResponseWriter)

Jump to

Keyboard shortcuts

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