MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / newPaginationFromReq

Function newPaginationFromReq

sqlchain/observer/api.go:68–86  ·  view source on GitHub ↗
(r *http.Request)

Source from the content-addressed store, hash-verified

66}
67
68func newPaginationFromReq(r *http.Request) (op *paginationOps) {
69 op = &paginationOps{}
70 op.page, _ = strconv.Atoi(r.URL.Query().Get("page"))
71 op.size, _ = strconv.Atoi(r.URL.Query().Get("size"))
72 if r.URL.Query().Get("type") == types.ReadQuery.String() {
73 op.queryType = types.ReadQuery
74 } else if r.URL.Query().Get("type") == types.WriteQuery.String() {
75 op.queryType = types.WriteQuery
76 } else {
77 op.queryType = types.NumberOfQueryType
78 }
79 if op.page <= 0 {
80 op.page = 1
81 }
82 if op.size <= 0 {
83 op.size = 10
84 }
85 return
86}
87
88func (a *explorerAPI) GetAllSubscriptions(rw http.ResponseWriter, r *http.Request) {
89 subscriptions, err := a.service.getAllSubscriptions()

Callers 4

GetBlockV3Method · 0.85
GetBlockByCountV3Method · 0.85
GetBlockByHeightV3Method · 0.85
GetHighestBlockV3Method · 0.85

Calls 3

GetMethod · 0.65
QueryMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected