Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoadBalancer ¶
type LoadBalancer interface { IsHealthy() bool 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.HealthChecker, certManager interfaces.YurtCertificateManager, filterChain filter.Interface, 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, healthChecker healthchecker.HealthChecker, filterChain filter.Interface, stopCh <-chan struct{}) (*RemoteProxy, error)
NewRemoteProxy creates an *RemoteProxy object, and will be used by LoadBalancer
func (*RemoteProxy) IsHealthy ¶
func (rp *RemoteProxy) IsHealthy() bool
IsHealthy returns healthy status of remote server
func (*RemoteProxy) Name ¶
func (rp *RemoteProxy) Name() string
Name represents the address of remote server
func (*RemoteProxy) ServeHTTP ¶
func (rp *RemoteProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.