Skip to content

Commit 0d260a8

Browse files
committed
update existing docs and add docs to list endpoint
1 parent 7ce03e2 commit 0d260a8

File tree

7 files changed

+1588
-230
lines changed

7 files changed

+1588
-230
lines changed

code/go/0chain.net/blobbercore/handler/handler.go

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
// 0chain Blobber API:
2-
// version: 0.0.1
3-
// title: 0chain Blobber API
4-
// Schemes: http, https
5-
// BasePath: /
6-
// Produces:
7-
// - application/json
8-
//
9-
// securityDefinitions:
10-
//
11-
// apiKey:
12-
// type: apiKey
13-
// in: header
14-
// name: authorization
15-
//
16-
// swagger:meta
171
package handler
182

193
import (
@@ -368,17 +352,26 @@ func FileMetaHandler(ctx context.Context, r *http.Request) (interface{}, error)
368352
//
369353
// parameters:
370354
//
371-
// +name: auth_token
372-
// description: auth token
373-
// required: true
374-
// in: body
375-
// type: string
355+
// +name: allocation
356+
// description: the allocation ID
357+
// required: true
358+
// in: path
359+
// type: string
376360
//
377-
// +name: txn_id
378-
// description: transaction id
361+
// +name: body
362+
// description: body
379363
// required: true
380364
// in: body
381-
// type: string
365+
// schema:
366+
// properties:
367+
// auth_token:
368+
// type: string
369+
// description: auth token
370+
// required: true
371+
// txn_id:
372+
// type: string
373+
// description: transaction id
374+
// required: true
382375
//
383376
// responses:
384377
//

code/go/0chain.net/blobbercore/handler/handler_main.go

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,54 @@ func SetupHandlers(r *mux.Router) {
2222
r.HandleFunc("/v1/file/download/{allocation}", RateLimitByFileRL(common.ToByteStream(WithConnection(DownloadHandler)))).Methods(http.MethodGet, http.MethodOptions)
2323
}
2424

25-
// swagger:route GET /v1/block/magic/get getmagicblock
26-
// a handler to respond to block queries
25+
26+
// swagger:route GET /v1/file/list/{allocation} list
27+
// ListHandler is the handler to respond to list requests from clients,
28+
// it returns a list of files in the allocation,
29+
// along with the metadata of the files.
30+
//
31+
// parameters:
32+
//
33+
// +name: allocation
34+
// description: TxHash of the allocation in question.
35+
// in: path
36+
// required: true
37+
// type: string
38+
// +name: list
39+
// description: Whether or not to list the files inside the directory, not just data about the path itself.
40+
// in: query
41+
// type: boolean
42+
// required: false
43+
// +name: limit
44+
// description: The number of files to return (for pagination).
45+
// in: query
46+
// type: integer
47+
// required: true
48+
// +name: offset
49+
// description: The number of files to skip before returning (for pagination).
50+
// in: query
51+
// type: integer
52+
// required: true
53+
// +name: X-App-Client-ID
54+
// description: The ID/Wallet address of the client sending the request.
55+
// in: header
56+
// type: string
57+
// required: true
58+
// +name: X-App-Client-Key
59+
// description: The key of the client sending the request.
60+
// in: header
61+
// type: string
62+
// required: true
63+
// +name: ALLOCATION-ID
64+
// description: The ID of the allocation in question.
65+
// in: header
66+
// type: string
67+
// required: true
2768
//
2869
// responses:
29-
// 200: ListResult
30-
// 404:
31-
/* ListHandler is the handler to respond to list requests from clients*/
70+
//
71+
// 200: ListResult
72+
3273
func ListHandler(ctx context.Context, r *http.Request) (interface{}, error) {
3374
return listHandler(ctx, r)
3475
}

code/go/0chain.net/docs/doc.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
// Package classification Züs Blobber API.
3+
//
4+
// Documentation of the blobber API.
5+
//
6+
// Schemes: https
7+
// BasePath: /
8+
// Version: 1.12.0
9+
//
10+
// swagger:meta
11+
package docs

code/go/0chain.net/swagger.md

Lines changed: 0 additions & 128 deletions
This file was deleted.

code/go/0chain.net/swagger.yaml

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)