Beispiel #1
0
func (t *traefik) NewServers(rsc *kubernetes.Resource) ([]loadbalancer.Server, error) {
	list := make([]loadbalancer.Server, 0, 1)
	for _, srv := range rsc.Servers() {
		s := types.Server{URL: srv.URL().String(), Weight: 1}
		list = append(list, &server{Server: s, id: srv.ID()})
	}
	return list, nil
}
Beispiel #2
0
func (v *vulcan) NewServers(rsc *kubernetes.Resource) ([]loadbalancer.Server, error) {
	list := make([]loadbalancer.Server, 0, 1)
	for _, server := range rsc.Servers() {
		s, er := engine.NewServer(server.ID(), server.URL().String())
		if er != nil {
			return list, er
		}
		list = append(list, newServer(s))
	}
	return list, nil
}