httpproxy

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConnectErrorKey contextKey = "connectErrorConextKey"

ConnectErrorKey :

Functions

func AddLogHandler

func AddLogHandler(h http.Handler, accesslogger *zap.Logger) http.Handler

AddLogHandler :

Types

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

Proxy : Provide host-based proxy server.

func NewProxy

func NewProxy(upstream *upstream.Upstream, opts *opts.Cmd, logger *zap.Logger) *Proxy

NewProxy : Create a request-based reverse-proxy.

func (*Proxy) ServeHTTP

func (proxy *Proxy) ServeHTTP(writer http.ResponseWriter, originalRequest *http.Request)

type State

type State struct {
	// contains filtered or unexported fields
}

State :

func (*State) Fail

func (c *State) Fail()

Fail :

func (*State) IsFail

func (c *State) IsFail() bool

IsFail :

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer :

func WrapWriter

func WrapWriter(w http.ResponseWriter) *Writer

WrapWriter :

func (*Writer) GetCode

func (w *Writer) GetCode() int

GetCode :

func (*Writer) GetSize

func (w *Writer) GetSize() int

GetSize :

func (*Writer) Header

func (w *Writer) Header() http.Header

Header :

func (*Writer) Write

func (w *Writer) Write(b []byte) (int, error)

Write :

func (*Writer) WriteHeader

func (w *Writer) WriteHeader(statusCode int)

WriteHeader :

Jump to

Keyboard shortcuts

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