partlib

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package partlib includes supporting functions for parts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamTextFile

func StreamTextFile(pathIn <-chan string, output chan<- FileLine, errors chan<- error)

StreamTextFile reads files to read from an input channel, and streams text lines from the file as strings to the output.

Types

type FileLine

type FileLine struct {
	Path, Line string
	LineNum    int
}

FileLine represents a single line from a text file. It includes the file path, the line itself, and the line number starting from 0.

type HTTPHandlerChan

type HTTPHandlerChan chan<- HTTPRequest

HTTPHandlerChan is a channel that can be sent HTTPRequests, thus supporting a simple implementation of ServerHTTP.

func (HTTPHandlerChan) ServeHTTP

func (h HTTPHandlerChan) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HTTPRequest

type HTTPRequest interface {
	http.ResponseWriter
	Info() *http.Request
	Close() error
}

HTTPRequest represents incoming HTTP requests and the means to respond to them.

Jump to

Keyboard shortcuts

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