(sc *ServerContext)
| 404 | } |
| 405 | |
| 406 | func createDiagnosticRouter(sc *ServerContext) *mux.Router { |
| 407 | r := NewRouter(sc, diagnosticServer) |
| 408 | |
| 409 | dbr := r.PathPrefix("/{db:" + dbRegex + "}/").Subrouter() |
| 410 | dbr.StrictSlash(true) |
| 411 | keyspace := r.PathPrefix("/{keyspace:" + dbRegex + "}/").Subrouter() |
| 412 | keyspace.StrictSlash(true) |
| 413 | keyspace.Handle("/{docid:"+docRegex+"}/_all_channels", makeHandler(sc, adminPrivs, []Permission{PermReadAppData}, nil, (*handler).handleGetDocChannels)).Methods("GET") |
| 414 | keyspace.Handle("/_user/{name}", makeHandler(sc, adminPrivs, []Permission{PermReadAppData}, nil, (*handler).handleGetUserDocAccessSpan)).Methods("GET") |
| 415 | keyspace.Handle("/_sync", makeHandler(sc, adminPrivs, []Permission{PermReadAppData}, nil, (*handler).handleSyncFnDryRun)).Methods("POST") |
| 416 | keyspace.Handle("/_import_filter", makeHandler(sc, adminPrivs, []Permission{PermReadAppData}, nil, (*handler).handleImportFilterDryRun)).Methods("POST") |
| 417 | dbr.Handle("/_user/{name}/_all_channels", |
| 418 | makeHandler(sc, adminPrivs, []Permission{PermReadPrincipal}, nil, (*handler).handleGetAllChannels)).Methods("GET") |
| 419 | |
| 420 | return r |
| 421 | } |
| 422 | |
| 423 | // Returns a top-level HTTP handler for a Router. This adds behavior for URLs that don't |
| 424 | // match anything -- it handles the OPTIONS method as well as returning either a 404 or 405 |
no test coverage detected