MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / createDiagnosticRouter

Function createDiagnosticRouter

rest/routing.go:406–421  ·  view source on GitHub ↗
(sc *ServerContext)

Source from the content-addressed store, hash-verified

404}
405
406func 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

Callers 1

createDiagnosticHandlerFunction · 0.85

Calls 2

NewRouterFunction · 0.85
makeHandlerFunction · 0.85

Tested by

no test coverage detected