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) }
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 }