proxy

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackwardProxy deprecated

type BackwardProxy = ReverseProxy

Deprecated: BackwardProxy is deprecated, use ReverseProxy instead.

type Config

type Config struct {
	ServerInfo   *rpcinfo.EndpointBasicInfo
	Resolver     discovery.Resolver
	Balancer     loadbalance.Loadbalancer
	Pool         remote.ConnPool
	FixedTargets string // A comma separated list of host ports that user specify to use.
	RPCConfig    rpcinfo.RPCConfig
}

Config contains basic components used in service discovery process.

type ContextHandler added in v0.1.0

type ContextHandler interface {
	HandleContext(context.Context) context.Context
}

ContextHandler is to handle context info, it just be used for passing params when client/server initialization. Eg: Customized endpoint.MiddlewareBuilder need get init information to judge if it is necessary to add the middleware into the call chain.

type ForwardProxy

type ForwardProxy interface {
	// Configure is provided to initialize the proxy.
	Configure(*Config) error

	// ResolveProxyInstance set instance for remote endpoint.
	ResolveProxyInstance(ctx context.Context) error
}

ForwardProxy manages the service discovery, load balance and connection pooling processes.

type ReverseProxy added in v0.1.0

type ReverseProxy interface {
	Replace(net.Addr) (net.Addr, error)
}

ReverseProxy replaces the listen address with another one.

type WithMiddleware added in v0.8.0

type WithMiddleware interface {
	// ProxyMiddleware returns a middleware which implement proxy logic.
	ProxyMiddleware() endpoint.Middleware
}

WithMiddleware provides function to customize proxy middleware implementation.

Jump to

Keyboard shortcuts

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