Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EndpointList ¶
type EndpointList []Endpoint
EndpointList
func (*EndpointList) HaveEndpoint ¶
func (e *EndpointList) HaveEndpoint(endpoint string) bool
HaveEndpoint whether or not there is an endpoint
type HTTPProxy ¶
type HTTPProxy struct {
// contains filtered or unexported fields
}
HTTPProxy
func (*HTTPProxy) Proxy ¶
func (h *HTTPProxy) Proxy(w http.ResponseWriter, r *http.Request)
Proxy http proxy
func (*HTTPProxy) UpdateEndpoints ¶
UpdateEndpoints
type LoadBalance ¶
type LoadBalance interface {
Select(r *http.Request, endpoints EndpointList) Endpoint
}
LoadBalance
type Proxy ¶
type Proxy interface { Proxy(w http.ResponseWriter, r *http.Request) Do(r *http.Request) (*http.Response, error) UpdateEndpoints(endpoints ...string) // format: ["name=>ip:port", ...] }
Proxy proxy
type RoundRobin ¶
type RoundRobin struct {
// contains filtered or unexported fields
}
RoundRobin loadBalance impl
func (RoundRobin) Select ¶
func (rr RoundRobin) Select(r *http.Request, endpoints EndpointList) Endpoint
Select select a server from servers using RoundRobin
type SelectBalance ¶
type SelectBalance struct {
// contains filtered or unexported fields
}
SelectBalance selective load balancing
func NewSelectBalance ¶
func NewSelectBalance() *SelectBalance
NewSelectBalance create selective load balancing
func (*SelectBalance) Select ¶
func (s *SelectBalance) Select(r *http.Request, endpoints EndpointList) Endpoint
Select load
type WebSocketProxy ¶
type WebSocketProxy struct {
// contains filtered or unexported fields
}
WebSocketProxy
func (*WebSocketProxy) Proxy ¶
func (h *WebSocketProxy) Proxy(w http.ResponseWriter, req *http.Request)
Proxy websocket proxy
func (*WebSocketProxy) UpdateEndpoints ¶
func (h *WebSocketProxy) UpdateEndpoints(endpoints ...string)
UpdateEndpoints
Click to show internal directories.
Click to hide internal directories.