http

package
v0.3.29 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ModuleDirective = "http"

Variables

This section is empty.

Functions

This section is empty.

Types

type Http

type Http struct {
	RoundTrippers RoundTrippersMap
}

func New

func New() *Http

func (*Http) Call

func (t *Http) Call(command conf.Command) error

func (*Http) CallBlock

func (t *Http) CallBlock(command conf.Command) (conf.Block, error)

func (*Http) Clone

func (t *Http) Clone() prifma.Module

func (*Http) GetDirective

func (t *Http) GetDirective() string

func (*Http) HandleRequest

func (t *Http) HandleRequest(result prifma.HandleRequestResult) (prifma.HandleRequestResult, error)

type ResponseReverseProxy

type ResponseReverseProxy struct {
	RoundTrippers RoundTrippersMap
	ResponseCode  int
	Error         error
	LAddr         net.Addr
	RAddr         net.Addr
}

func NewResponseReverseProxy

func NewResponseReverseProxy(roundTrippers RoundTrippersMap) *ResponseReverseProxy

func (*ResponseReverseProxy) ErrorHandler

func (t *ResponseReverseProxy) ErrorHandler(rw http.ResponseWriter, req *http.Request, err error)

func (*ResponseReverseProxy) GetCode

func (t *ResponseReverseProxy) GetCode() int

func (*ResponseReverseProxy) GetLAddr

func (t *ResponseReverseProxy) GetLAddr() net.Addr

func (*ResponseReverseProxy) GetRAddr

func (t *ResponseReverseProxy) GetRAddr() net.Addr

func (*ResponseReverseProxy) SaveResponse

func (t *ResponseReverseProxy) SaveResponse(resp *http.Response) error

func (*ResponseReverseProxy) Write

type RoundTripperKey

type RoundTripperKey struct {
	ProxyUrl    string
	ProxyHeader string
	LocalIp     string
}

func NewRoundTripperKey

func NewRoundTripperKey(result prifma.HandleRequestResult) RoundTripperKey

type RoundTrippersMap

type RoundTrippersMap interface {
	Get(result prifma.HandleRequestResult) http.RoundTripper
}

type SyncRoundTrippersMap

type SyncRoundTrippersMap struct {
	RWMutex       *sync.RWMutex
	RoundTrippers map[RoundTripperKey]http.RoundTripper
}

func NewSyncRoundTrippersMap

func NewSyncRoundTrippersMap() *SyncRoundTrippersMap

func (*SyncRoundTrippersMap) Get

Jump to

Keyboard shortcuts

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