VOL-1848 API for setting and querying loglevel of api-server;
Add source-router to support routing UpdateLogLevel to cores;
Add logging endpoints to rocore
Change-Id: I89eea3599ea3006fe92e6917221cd1fd235ec5e4
diff --git a/afrouter/afrouter/router.go b/afrouter/afrouter/router.go
index 1bd2d6e..7abbceb 100644
--- a/afrouter/afrouter/router.go
+++ b/afrouter/afrouter/router.go
@@ -27,7 +27,11 @@
// The router interface
type Router interface {
Name() string
- Route(interface{}) *backend
+
+ // Route() returns a backend and a connection. The connection is optional and if unspecified, then any
+ // connection on the backend may be used.
+ Route(interface{}) (*backend, *connection)
+
Service() string
IsStreaming(string) (bool, bool)
BackendCluster(string, string) (*cluster, error)
@@ -64,6 +68,12 @@
allRouters[rconf.Name+config.Name] = r
}
return r, err
+ case RouteTypeSource:
+ r, err := newSourceRouter(rconf, config)
+ if err == nil {
+ allRouters[rconf.Name+config.Name] = r
+ }
+ return r, err
default:
return nil, errors.New(fmt.Sprintf("Internal error, undefined router type: %s", config.Type))
}