http

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FastHttpProxy added in v1.4.0

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

func (*FastHttpProxy) HandleRequest added in v1.4.0

func (f *FastHttpProxy) HandleRequest(ctx *fasthttp.RequestCtx)

func (*FastHttpProxy) RewriteQuery added in v1.4.0

func (f *FastHttpProxy) RewriteQuery(config proxy.RequestConfig, userValues map[string][]byte, requestURI []byte, query []byte, out io.Writer) error

func (*FastHttpProxy) SetUserValues added in v1.4.0

func (f *FastHttpProxy) SetUserValues(userValues *map[string][]byte, header fasthttp.RequestHeader, addHeaders [][]byte)

type FastStaticProxy added in v1.4.0

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

func NewFastStaticProxy added in v1.4.0

func NewFastStaticProxy(config FastStaticProxyConfig) *FastStaticProxy

func (*FastStaticProxy) ListenAndServe added in v1.4.0

func (f *FastStaticProxy) ListenAndServe(addr string) error

type FastStaticProxyConfig added in v1.4.0

type FastStaticProxyConfig struct {
	MiddleWares           []middleware.GraphqlMiddleware
	RequestConfigProvider proxy.RequestConfigProvider
}

type GraphqlJsonRequest added in v1.4.0

type GraphqlJsonRequest struct {
	OperationName string `json:"operationName"`
	Query         string `json:"query"`
}

type Proxy

type Proxy struct {
	RequestConfigProvider proxy.RequestConfigProvider
	Host                  string
	InvokerPool           sync.Pool
	Client                http.Client
	HandleError           func(err error, w http.ResponseWriter)
	BufferPool            sync.Pool
	BufferedReaderPool    sync.Pool
}

func NewDefaultProxy

func NewDefaultProxy(host string, provider proxy.RequestConfigProvider, middlewares ...middleware.GraphqlMiddleware) *Proxy

func (*Proxy) AcceptRequest

func (p *Proxy) AcceptRequest(userValues map[string][]byte, requestURI []byte, body io.Reader, buff *bytes.Buffer) error

func (*Proxy) AcceptResponse

func (p *Proxy) AcceptResponse()

func (*Proxy) DispatchRequest

func (p *Proxy) DispatchRequest(buff *bytes.Buffer) (*http.Response, error)

func (*Proxy) DispatchResponse

func (p *Proxy) DispatchResponse()

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

type StaticProxy added in v1.4.0

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

func NewStaticProxy added in v1.4.0

func NewStaticProxy(config StaticProxyConfig) *StaticProxy

func (*StaticProxy) ListenAndServe added in v1.4.0

func (s *StaticProxy) ListenAndServe(addr string) error

type StaticProxyConfig added in v1.4.0

type StaticProxyConfig struct {
	MiddleWares           []middleware.GraphqlMiddleware
	RequestConfigProvider proxy.RequestConfigProvider
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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