http

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2016 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package http provides streaming implementations of various net/http types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Heartbeat

func Heartbeat(outStream io.Writer, interval time.Duration) chan struct{}

Heartbeat sends the null character periodically, to keep the connection alive.

Types

type ResponseWriter

type ResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

ResponseWriter provides an implementation of the http.ResponseWriter interface that is unbuffered. Every call to write will be flushed to the underyling connection and streamed to the client.

func StreamingResponseWriter

func StreamingResponseWriter(w http.ResponseWriter) *ResponseWriter

StreamingResponseWriter wraps the http.ResponseWriter with unbuffered streaming. If the provided ResponseWriter does not implement http.Flusher, this function will panic.

func (*ResponseWriter) Write

func (w *ResponseWriter) Write(p []byte) (int, error)

Write delegates to the underlying flushWriter to perform the write and flush it to the connection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL