Ejemplo n.º 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)
}
Ejemplo n.º 2
0
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
}