...

Package sse

import "github.com/gin-contrib/sse"
Overview
Index

Overview ▾

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)