Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loadbalancer ¶
type Loadbalancer struct { Port string // contains filtered or unexported fields }
func NewLoadBalancer ¶
func NewLoadBalancer(port string, servers []SimpleServer) *Loadbalancer
Creates and returns a new loadbalancer instance
func (*Loadbalancer) ServeProxy ¶
func (loadbalancer *Loadbalancer) ServeProxy(rw http.ResponseWriter, req *http.Request)
Forwards the request to the server returned by the getNextAvailableServer method
type SimpleServer ¶
type SimpleServer struct {
// contains filtered or unexported fields
}
func NewSimpleServer ¶
func NewSimpleServer(addr string, weight int) *SimpleServer
Creates a new instance of the simpleServer struct
func (*SimpleServer) Address ¶
func (s *SimpleServer) Address() string
Returns the adress of the simple server instance
func (*SimpleServer) Serve ¶
func (s *SimpleServer) Serve(rw http.ResponseWriter, req *http.Request)
Serves the through the reverse proxy
Click to show internal directories.
Click to hide internal directories.