Range

An struct containg the type and a slice of ranges will be returned.

  1. c.Range(int size)
  1. // Range: bytes=500-700, 700-900
  2. app.Get("/", func(c *fiber.Ctx) {
  3. b := c.Range(1000)
  4. if b.Type == "bytes" {
  5. for r := range r.Ranges {
  6. fmt.Println(r)
  7. // [500, 700]
  8. }
  9. }
  10. })