proxy

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

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

Go to latest
Published: Jul 1, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTPRespOK         = 0
	HTTPRespAuthFailed = -1
	HTTPRespProcFailed = -2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPResponse

type HTTPResponse struct {
	Code    int
	Message string
	Data    interface{}
}

HTTPResponse HTTPResponse

type HandleReverse

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

HandleReverse HandleReverse

func (*HandleReverse) DoFilteringAsBegin

func (h *HandleReverse) DoFilteringAsBegin(ctx filter.Context) filter.Response

DoFilteringAsBegin return (resp, nil) if all filters passed, else (resp, err)

func (*HandleReverse) DoFilteringAsEnd

func (h *HandleReverse) DoFilteringAsEnd(ctx filter.Context) filter.Response

DoFilteringAsEnd return (resp, nil) if all filters passed, else (resp, err)

func (*HandleReverse) ServeHTTP

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

type Proxy

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

Proxy proxy struct

func NewProxy

func NewProxy(confpath string) *Proxy

NewProxy creates a new proxy instance

func (*Proxy) RegisterFilters

func (p *Proxy) RegisterFilters(filters []filter.Filter)

RegisterFilters register filters into proxy

func (*Proxy) Start

func (p *Proxy) Start()

Start start the proxy

Jump to

Keyboard shortcuts

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