proxy

package
v0.0.0-...-6cc5b44 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	serviceDefService metadata.ServiceDefinitionService,
	authorizationStrategyFactory authorization.StrategyFactory,
	csrfTokenStrategyFactory csrf.TokenStrategyFactory,
	config Config) http.Handler

New creates proxy for handling user's services calls

func NewForCompass

func NewForCompass(
	serviceDefService metadata.ServiceDefinitionService,
	authorizationStrategyFactory authorization.StrategyFactory,
	csrfTokenStrategyFactory csrf.TokenStrategyFactory,
	config Config) http.Handler

Types

type APIExtractor

type APIExtractor interface {
	Get(identifier model.APIIdentifier) (*model.API, apperrors.AppError)
}

type Cache

type Cache interface {
	// Get returns entry from the cache
	Get(appName, serviceName, apiName string) (*CacheEntry, bool)
	// Put adds entry to the cache
	Put(appName, serviceName, apiName string, reverseProxy *httputil.ReverseProxy, authorizationStrategy authorization.Strategy, csrfTokenStrategy csrf.TokenStrategy, clientCertificate clientcert.ClientCertificate) *CacheEntry
}

Cache is an interface for caching Proxies

func NewCache

func NewCache(proxyCacheTTL int) Cache

NewCache creates new cache with specified TTL

type CacheEntry

type CacheEntry struct {
	Proxy                 *httputil.ReverseProxy
	AuthorizationStrategy *authorizationStrategyWrapper
	CSRFTokenStrategy     csrf.TokenStrategy
}

CacheEntry stores information about proxy configuration in cache

type Config

type Config struct {
	ProxyTimeout  int
	Application   string
	ProxyCacheTTL int
}

Config stores Proxy config

type RetryableRoundTripper

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

func NewRetryableRoundTripper

func NewRetryableRoundTripper(roundTripper http.RoundTripper, authorizationStrategy authorization.Strategy, csrfTokenStrategy csrf.TokenStrategy, clientCertificate clientcert.ClientCertificate, timeout int, skipTLSVerify bool) *RetryableRoundTripper

func (*RetryableRoundTripper) RoundTrip

func (p *RetryableRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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