MCPcopy
hub / github.com/perkeep/perkeep / discovery

Method discovery

pkg/server/ui.go:499–521  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

497}
498
499func (ui *UIHandler) discovery() *camtypes.UIDiscovery {
500 pubRoots := map[string]*camtypes.PublishRootDiscovery{}
501 for _, v := range ui.publishRoots {
502 rd := &camtypes.PublishRootDiscovery{
503 Name: v.Name,
504 Prefix: []string{v.Prefix},
505 CurrentPermanode: v.Permanode,
506 }
507 pubRoots[v.Name] = rd
508 }
509
510 mapClustering, _ := strconv.ParseBool(os.Getenv("CAMLI_DEV_MAP_CLUSTERING"))
511 uiDisco := &camtypes.UIDiscovery{
512 UIRoot: ui.prefix,
513 UploadHelper: ui.prefix + "?camli.mode=uploadhelper",
514 DownloadHelper: path.Join(ui.prefix, "download") + "/",
515 DirectoryHelper: path.Join(ui.prefix, "tree") + "/",
516 PublishRoots: pubRoots,
517 MapClustering: mapClustering,
518 ImportShare: path.Join(ui.prefix, "importshare") + "/",
519 }
520 return uiDisco
521}
522
523func (ui *UIHandler) serveDownload(w http.ResponseWriter, r *http.Request) {
524 if ui.root.Storage == nil {

Callers 1

serveDiscoveryMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected