Back to godoc.org
github.com/gin-contrib/sse

package sse

v0.1.0
Latest Go to latest
Published: Jun 2, 2019 | License: MIT | Module: github.com/gin-contrib/sse

Index

Constants

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
f or F : Jump to identifier