mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-16 18:37:51 +01:00
Add special type -2 to /explore.
This commit is contained in:
@@ -196,6 +196,12 @@ func createTestResult(fileType int) (file core.BlockRecordFile) {
|
||||
|
||||
}
|
||||
} else {
|
||||
if fileType == -2 {
|
||||
// Binary, Compressed, Container, Executable
|
||||
otherList := []int{core.TypeBinary, core.TypeCompressed, core.TypeContainer, core.TypeExecutable}
|
||||
fileType = otherList[rand.Intn(len(otherList))]
|
||||
}
|
||||
|
||||
file.Type = uint8(fileType)
|
||||
switch file.Type {
|
||||
case core.TypeBinary:
|
||||
|
||||
@@ -215,7 +215,9 @@ func apiSearchTerminate(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
/*
|
||||
apiExplore returns recently shared files in Peernet. Results are returned in real-time. The file type is an optional filter.
|
||||
apiExplore returns recently shared files in Peernet. Results are returned in real-time. The file type is an optional filter. See TypeX.
|
||||
Special type -2 = Binary, Compressed, Container, Executable. This special type includes everything except Documents, Video, Audio, Ebooks, Picture, Text.
|
||||
|
||||
Request: GET /explore?limit=[max records]&type=[file type]
|
||||
Result: 200 with JSON structure SearchResult. Check the field status.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user