// reload reloads settings during runtime
reload reloads settings during runtime
// reload reloads settings during runtime
func (p *HTTPProxy) reload() error {
	if p.Address == "" {
		p.Address = ":80"
	}
	for i, r := range p.Rules {
		{
			url, err := url.Parse(r.URL)
			if err != nil {
				return err
			}
			log.Debugf("set rule mapping %s=>%s", r.Path, url)
			p.Rules[i].url = url
			if r.Weight == 0 {
				p.Rules[i].Weight = 1
			} else if r.Weight < 0 {
				return fmt.Errorf("Weight cannot be less than 1")
			}
		}
	}
	return nil
}
func ( p * HTTPProxy ) reload ( ) error { if p . Address == " " { p . Address = " " } for i , r := range p . Rules { { url , err := url . Parse ( r . URL ) if err != nil { return err } log . Debugf ( " " , r . Path , url ) p . Rules [ i ] . url = url if r . Weight == 0 { p . Rules [ i ] . Weight = 1 } else if r . Weight < 0 { return fmt . Errorf ( " " ) } } } return nil }
reload reloads settings during runtime
reload reloads settings during runtime
// Weight cannot be less than 1