pipe

package
v0.0.0-...-4bdf62d Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: GPL-2.0-or-later Imports: 11 Imported by: 0

Documentation

Overview

The pipe package provides various tools to transform data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PipeExec

type PipeExec struct {
	Command     []string
	ContentType string
}

PipeExec reads from stdin passing the data into stdin of the command. stdout is written to the provided writers. The content type is set as directed

func (*PipeExec) Transform

func (p *PipeExec) Transform(ctx context.Context, r *http.Response) error

type PipeHandler

type PipeHandler struct {
	ResponsePipe ResponsePipe
	Handler      http.Handler
}

PipeHandler passes the output of the wrapped Handler through the supplied ResponsePipe.

func (*PipeHandler) ServeHTTP

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

type ResponsePipe

type ResponsePipe interface {
	Transform(context.Context, *http.Response) error
}

Jump to

Keyboard shortcuts

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