File tree Expand file tree Collapse file tree 1 file changed +34
-3
lines changed Expand file tree Collapse file tree 1 file changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -985,9 +985,40 @@ app.Get("/", func(c *fiber.Ctx) {
985
985
986
986
## Range
987
987
988
- {% hint style="info" %}
989
- Coming soon! Feel free to create a PR!
990
- {% endhint %}
988
+ An struct containg the type and a slice of ranges will be returned.
989
+
990
+ ** Signature**
991
+
992
+ ``` go
993
+ c.Range (int size)
994
+ ```
995
+
996
+ ** Range struct**
997
+
998
+ ``` go
999
+ type Range struct {
1000
+ Type string
1001
+ Ranges []struct {
1002
+ Start int64
1003
+ End int64
1004
+ }
1005
+ }
1006
+ ```
1007
+
1008
+ ** Example**
1009
+
1010
+ ``` go
1011
+ // Range: bytes=500-700, 700-900
1012
+ app.Get (" /" , func (c *fiber.Ctx ) {
1013
+ b := c.Range (1000 )
1014
+ if b.Type == " bytes" {
1015
+ for r := range r.Ranges {
1016
+ fmt.Println (r)
1017
+ // [500, 700]
1018
+ }
1019
+ }
1020
+ })
1021
+ ```
991
1022
992
1023
## Redirect
993
1024
You can’t perform that action at this time.
0 commit comments