sse: Index | Files | Directories

package sse

import ""


Package Files

EventServer.go Writer.go


var FlushUnsupported = fmt.Errorf("Streaming not supported")

type EventServer Uses

type EventServer struct {
    // contains filtered or unexported fields

func NewEventServer Uses

func NewEventServer(opts *EventServerOptions) *EventServer

func (*EventServer) Event Uses

func (x *EventServer) Event(id, event, msg string)

func (*EventServer) Handle Uses

func (x *EventServer) Handle(w http.ResponseWriter, r *http.Request)

func (*EventServer) JSONEvent Uses

func (x *EventServer) JSONEvent(id string, event string, obj interface{})

func (*EventServer) JSONMessage Uses

func (x *EventServer) JSONMessage(obj interface{})

func (*EventServer) Message Uses

func (x *EventServer) Message(msg string)

type EventServerOptions Uses

type EventServerOptions struct {
    ActionQueueLength int
    LogLabel          string
    RetryMillis       int
    HistoryLimit      int

type Writer Uses

type Writer struct {

    // Response is the HTTP response object.
    Response http.ResponseWriter
    Flusher  http.Flusher

    // Request is the incoming HTTP request.  The Accept header is
    // checked to determine what the output Content-Type should be.
    Request *http.Request

    // True if the connection accepts SSE streams.
    SSE bool

func NewWriter Uses

func NewWriter(w http.ResponseWriter, r *http.Request, retrymillis int) (*Writer, error)

func (*Writer) Event Uses

func (x *Writer) Event(id string, event string, data string) (int, error)



Package sse imports 5 packages (graph) and is imported by 2 packages. Updated 2016-12-20. Refresh now. Tools for package owners.