go-sse: github.com/gotvitch/go-sse Index | Files | Directories

package sse

import "github.com/gotvitch/go-sse"

Index

Package Files

conn.go sse.go

Variables

var (
    ErrStreamingNotSupported = errors.New("Streaming not supported")
    ErrConnectionClosed      = errors.New("Connection already closed")
    ErrConnectionTimeout     = errors.New("Connection timeout")
)
var DefaultOptions = Options{
    Timeout:   30,
    RetryTime: 0,
}

type Conn Uses

type Conn struct {
    Closed      chan error
    LastEventID int
    // contains filtered or unexported fields
}

func Upgrade Uses

func Upgrade(w http.ResponseWriter, r *http.Request, options Options) (*Conn, error)

func (*Conn) Close Uses

func (c *Conn) Close()

func (*Conn) IsOpen Uses

func (c *Conn) IsOpen() bool

func (*Conn) Send Uses

func (c *Conn) Send(event string, data interface{}) error

func (*Conn) SendEvent Uses

func (c *Conn) SendEvent(event *Event) error

type Event Uses

type Event struct {
    ID    string
    Event string
    Data  interface{}
}

type Options Uses

type Options struct {
    Timeout   int
    RetryTime int
}

Directories

PathSynopsis
exemple

Package sse imports 6 packages (graph) and is imported by 1 packages. Updated 2017-05-20. Refresh now. Tools for package owners.