+35
-8
appview/state/repo.go
+35
-8
appview/state/repo.go
···
35
log.Println("failed to fully resolve repo", err)
36
return
37
}
38
var reqUrl string
39
if ref != "" {
40
-
reqUrl = fmt.Sprintf("http://%s/%s/%s/tree/%s", f.Knot, f.OwnerDid(), f.RepoName, ref)
41
} else {
42
-
reqUrl = fmt.Sprintf("http://%s/%s/%s", f.Knot, f.OwnerDid(), f.RepoName)
43
}
44
45
resp, err := http.Get(reqUrl)
···
101
}
102
103
ref := chi.URLParam(r, "ref")
104
-
resp, err := http.Get(fmt.Sprintf("http://%s/%s/%s/log/%s?page=%d&per_page=30", f.Knot, f.OwnerDid(), f.RepoName, ref, page))
105
if err != nil {
106
log.Println("failed to reach knotserver", err)
107
return
···
229
log.Println("failed to fully resolve repo", err)
230
return
231
}
232
-
233
ref := chi.URLParam(r, "ref")
234
-
resp, err := http.Get(fmt.Sprintf("http://%s/%s/%s/commit/%s", f.Knot, f.OwnerDid(), f.RepoName, ref))
235
if err != nil {
236
log.Println("failed to reach knotserver", err)
237
return
···
268
269
ref := chi.URLParam(r, "ref")
270
treePath := chi.URLParam(r, "*")
271
-
resp, err := http.Get(fmt.Sprintf("http://%s/%s/%s/tree/%s/%s", f.Knot, f.OwnerDid(), f.RepoName, ref, treePath))
272
if err != nil {
273
log.Println("failed to reach knotserver", err)
274
return
···
318
return
319
}
320
321
-
resp, err := http.Get(fmt.Sprintf("http://%s/%s/%s/tags", f.Knot, f.OwnerDid(), f.RepoName))
322
if err != nil {
323
log.Println("failed to reach knotserver", err)
324
return
···
390
391
ref := chi.URLParam(r, "ref")
392
filePath := chi.URLParam(r, "*")
393
-
resp, err := http.Get(fmt.Sprintf("http://%s/%s/%s/blob/%s/%s", f.Knot, f.OwnerDid(), f.RepoName, ref, filePath))
394
if err != nil {
395
log.Println("failed to reach knotserver", err)
396
return
···
35
log.Println("failed to fully resolve repo", err)
36
return
37
}
38
+
protocol := "http"
39
+
if !s.config.Dev {
40
+
protocol = "https"
41
+
}
42
+
43
var reqUrl string
44
if ref != "" {
45
+
reqUrl = fmt.Sprintf("%s://%s/%s/%s/tree/%s", protocol, f.Knot, f.OwnerDid(), f.RepoName, ref)
46
} else {
47
+
reqUrl = fmt.Sprintf("%s://%s/%s/%s", protocol, f.Knot, f.OwnerDid(), f.RepoName)
48
}
49
50
resp, err := http.Get(reqUrl)
···
106
}
107
108
ref := chi.URLParam(r, "ref")
109
+
110
+
protocol := "http"
111
+
if !s.config.Dev {
112
+
protocol = "https"
113
+
}
114
+
115
+
resp, err := http.Get(fmt.Sprintf("%s://%s/%s/%s/log/%s?page=%d&per_page=30", protocol, f.Knot, f.OwnerDid(), f.RepoName, ref, page))
116
if err != nil {
117
log.Println("failed to reach knotserver", err)
118
return
···
240
log.Println("failed to fully resolve repo", err)
241
return
242
}
243
ref := chi.URLParam(r, "ref")
244
+
protocol := "http"
245
+
if !s.config.Dev {
246
+
protocol = "https"
247
+
}
248
+
resp, err := http.Get(fmt.Sprintf("%s://%s/%s/%s/commit/%s", protocol, f.Knot, f.OwnerDid(), f.RepoName, ref))
249
if err != nil {
250
log.Println("failed to reach knotserver", err)
251
return
···
282
283
ref := chi.URLParam(r, "ref")
284
treePath := chi.URLParam(r, "*")
285
+
protocol := "http"
286
+
if !s.config.Dev {
287
+
protocol = "https"
288
+
}
289
+
resp, err := http.Get(fmt.Sprintf("%s://%s/%s/%s/tree/%s/%s", protocol, f.Knot, f.OwnerDid(), f.RepoName, ref, treePath))
290
if err != nil {
291
log.Println("failed to reach knotserver", err)
292
return
···
336
return
337
}
338
339
+
protocol := "http"
340
+
if !s.config.Dev {
341
+
protocol = "https"
342
+
}
343
+
344
+
resp, err := http.Get(fmt.Sprintf("%s://%s/%s/%s/tags", protocol, f.Knot, f.OwnerDid(), f.RepoName))
345
if err != nil {
346
log.Println("failed to reach knotserver", err)
347
return
···
413
414
ref := chi.URLParam(r, "ref")
415
filePath := chi.URLParam(r, "*")
416
+
protocol := "http"
417
+
if !s.config.Dev {
418
+
protocol = "https"
419
+
}
420
+
resp, err := http.Get(fmt.Sprintf("%s://%s/%s/%s/blob/%s/%s", protocol, f.Knot, f.OwnerDid(), f.RepoName, ref, filePath))
421
if err != nil {
422
log.Println("failed to reach knotserver", err)
423
return