Back to

Package sse

Latest Go to latest
Published: Jun 2, 2019 | License: MIT | Module:


Package Files


const ContentType = "text/event-stream"

func Encode

func Encode(writer io.Writer, event Event) error

type Event

type Event struct {
	Event string
	Id    string
	Retry uint
	Data  interface{}

func Decode

func Decode(r io.Reader) ([]Event, error)

func (Event) Render

func (r Event) Render(w http.ResponseWriter) error

func (Event) WriteContentType

func (r Event) WriteContentType(w http.ResponseWriter)
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier