proxy

package
v0.0.0-...-292cf52 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticator

func Authenticator(next http.Handler) http.Handler

func NewTransport

func NewTransport(cacher ResponseCacher, logger *logrus.Entry, debugHTTPRequest, debugHttpResponse bool) *transport

nolint

func PrepareRoutes

func PrepareRoutes(c *config.Config, log *logrus.Entry, server *Server) *chi.Mux

Types

type ResponseCache

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

ResponseCache implements ResponseCacher interface

func NewResponseCache

func NewResponseCache(cache cache.Cache, matcher matcher.Matcher) *ResponseCache

NewResponseCache fabric

func (*ResponseCache) Cacher

func (rc *ResponseCache) Cacher() cache.Cache

Cacher interface implementation

func (*ResponseCache) GetResponseCache

func (rc *ResponseCache) GetResponseCache(req requests.RPCRequest) (requests.RPCResponse, error)

GetResponseCache return response from the cache for the request

func (*ResponseCache) Matcher

func (rc *ResponseCache) Matcher() matcher.Matcher

Matcher interface implementation

func (*ResponseCache) SetResponseCache

func (rc *ResponseCache) SetResponseCache(req requests.RPCRequest, resp requests.RPCResponse) error

SetResponseCache sets response cache based on the request

type ResponseCacher

type ResponseCacher interface {
	SetResponseCache(requests.RPCRequest, requests.RPCResponse) error
	GetResponseCache(req requests.RPCRequest) (requests.RPCResponse, error)
	Matcher() matcher.Matcher
	Cacher() cache.Cache
}

ResponseCacher interface

type Server

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

func FromConfig

func FromConfig(ctx context.Context, c *config.Config) (*Server, error)

func FromConfigWithTransport

func FromConfigWithTransport(c *config.Config, log *logrus.Entry, transport *transport) (*Server, error)

func (Server) Close

func (t Server) Close() error

func (*Server) HealthFunc

func (p *Server) HealthFunc(w http.ResponseWriter, _ *http.Request)

HealthFunc health checking

func (*Server) RPCProxy

func (p *Server) RPCProxy(w http.ResponseWriter, r *http.Request)

func (*Server) ReadyFunc

func (p *Server) ReadyFunc(w http.ResponseWriter, _ *http.Request)

ReadyFunc readiness checking

func (Server) RoundTrip

func (t Server) RoundTrip(req *http.Request) (*http.Response, error)

func (*Server) StartHTTPServer

func (p *Server) StartHTTPServer(h http.Handler) *http.Server

StartHTTPServer starts http server

Jump to

Keyboard shortcuts

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