示例#1
0
func NewSessionWrapper(args ...interface{}) plugin.Wrapper {
	fmt.Printf("Active listener names%v\n", config.ActiveListenerNames())
	for _, al := range config.ActiveListenerNames() {
		sc := config.ActiveConfigForListener(al)
		switch sc {
		case nil:
			fmt.Println("Nil service config for", al)
		default:
			sc.LogConfig()
		}
	}
	return new(SessionWrapper)
}
示例#2
0
文件: lbutils.go 项目: xtracdev/xavi
func findBackend(backend string) (*config.ServiceBackend, error) {
	for _, listenerName := range config.ActiveListenerNames() {
		sc := config.ActiveConfigForListener(listenerName)

		for _, r := range sc.Routes {
			log.Infof("route config for %s:", r.Route.Name)
			for _, b := range r.Backends {
				if b.Backend.Name == backend {
					return b, nil
				}
			}
		}
	}

	return nil, ErrBackendNotFound
}