sse: go.pdmccormick.com/sse Index | Files

package sse

import "go.pdmccormick.com/sse"

Index

Package Files

eventstream.go

Constants

const (
    ContentType = "text/event-stream"
)

func EventWriter Uses

func EventWriter(w http.ResponseWriter) (io.Writer, error)

type Broadcaster Uses

type Broadcaster struct {
    // contains filtered or unexported fields
}

func (*Broadcaster) Add Uses

func (br *Broadcaster) Add(w io.Writer, errc chan<- error)

func (*Broadcaster) Remove Uses

func (br *Broadcaster) Remove(w io.Writer)

func (*Broadcaster) Write Uses

func (br *Broadcaster) Write(data []byte) (int, error)

type Decoder Uses

type Decoder struct {
    // contains filtered or unexported fields
}

func NewDecoder Uses

func NewDecoder(r io.Reader) *Decoder

func (*Decoder) Buffer Uses

func (dec *Decoder) Buffer(buf []byte, max int)

func (*Decoder) Decode Uses

func (dec *Decoder) Decode(ev *Event) error

func (*Decoder) Err Uses

func (dec *Decoder) Err() error

func (*Decoder) More Uses

func (dec *Decoder) More() bool

type Event Uses

type Event struct {
    Id      string
    Event   string
    RawData string
    Data    interface{}
    Retry   time.Duration
    Comment string
}

func (*Event) WriteTo Uses

func (ev *Event) WriteTo(w io.Writer) (n int64, err error)

Package sse imports 10 packages (graph). Updated 2020-11-24. Refresh now. Tools for package owners.