Added content-range headers

This commit is contained in:
Hein
2025-11-10 12:25:09 +02:00
parent 3eb17666bf
commit faafe5abea
5 changed files with 42 additions and 20 deletions

View File

@@ -0,0 +1,13 @@
package common
import "reflect"
func Len(v any) int {
val := reflect.ValueOf(v)
switch val.Kind() {
case reflect.Slice, reflect.Array, reflect.Map, reflect.String, reflect.Chan:
return val.Len()
default:
return 0
}
}

View File

@@ -18,6 +18,11 @@ type RequestOptions struct {
CustomOperators []CustomOperator `json:"customOperators"`
ComputedColumns []ComputedColumn `json:"computedColumns"`
Parameters []Parameter `json:"parameters"`
// Cursor pagination
CursorForward string `json:"cursor_forward"`
CursorBackward string `json:"cursor_backward"`
FetchRowNumber *string `json:"fetch_row_number"`
}
type Parameter struct {
@@ -68,6 +73,7 @@ type Response struct {
type Metadata struct {
Total int64 `json:"total"`
Count int64 `json:"count"`
Filtered int64 `json:"filtered"`
Limit int `json:"limit"`
Offset int `json:"offset"`