Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoadBalancer ¶
type LoadBalancer interface {
ServeHTTP(rw http.ResponseWriter, req *http.Request)
}
LoadBalancer is an interface for proxying http request to remote server based on the load balance mode(round-robin or priority)
func NewLoadBalancer ¶
func NewLoadBalancer( lbMode string, remoteServers []*url.URL, cacheMgr cachemanager.CacheManager, transportMgr transport.Interface, healthChecker healthchecker.MultipleBackendsHealthChecker, filterManager *manager.Manager, stopCh <-chan struct{}) (LoadBalancer, error)
NewLoadBalancer creates a loadbalancer for specified remote servers
type RemoteProxy ¶
type RemoteProxy struct {
// contains filtered or unexported fields
}
RemoteProxy is an reverse proxy for remote server
func NewRemoteProxy ¶
func NewRemoteProxy(remoteServer *url.URL, cacheMgr cachemanager.CacheManager, transportMgr transport.Interface, filterManager *manager.Manager, stopCh <-chan struct{}) (*RemoteProxy, error)
NewRemoteProxy creates an *RemoteProxy object, and will be used by LoadBalancer
func (*RemoteProxy) Name ¶
func (rp *RemoteProxy) Name() string
Name represents the address of remote server
func (*RemoteProxy) RemoteServer ¶ added in v1.1.0
func (rp *RemoteProxy) RemoteServer() *url.URL
func (*RemoteProxy) RoundTrip ¶ added in v0.6.0
RoundTrip is used to implement http.RoundTripper for RemoteProxy.
func (*RemoteProxy) ServeHTTP ¶
func (rp *RemoteProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.