• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jeffotoni / quick / 296

28 Mar 2025 12:12AM UTC coverage: 51.199% (+0.1%) from 51.093%
296

push

circleci

jeffotoni
Merge remote-tracking branch 'origin/docs/middleware'

update examples and docs

0 of 39 new or added lines in 12 files covered. (0.0%)

3 existing lines in 3 files now uncovered.

3074 of 6004 relevant lines covered (51.2%)

1667.28 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/example/quick.get/main.go
1
package main
2

3
import (
4
        "fmt"
5

6
        "github.com/jeffotoni/quick"
7
)
8

9
func main() {
×
10

×
11
        q := quick.New(
×
12
                quick.Config{
×
13
                        NoBanner: false,
×
14
                }) // Initialize Quick framework
×
15

×
16
        // Route to greet a user by name (dynamic route parameter)
×
17
        q.Get("/v1/user/:name", func(c *quick.Ctx) error {
×
18
                name := c.Param("name")                              // Retrieve the 'name' parameter from the URL
×
19
                c.Set("Content-Type", "text/plain")                  // Set response content type as plain text
×
20
                return c.Status(200).SendString("Olá " + name + "!") // Return greeting message
×
21
        })
×
22

23
        // Simple route returning a static message
24
        q.Get("/v2/user", func(c *quick.Ctx) error {
×
25
                c.Set("Content-Type", "application/json")            // Set response content type as JSON
×
26
                return c.Status(200).SendString("Opa, funcionando!") // Return confirmation message
×
27
        })
×
28

29
        // Route to return an ID from the URL
30
        q.Get("/v3/user/:id", func(c *quick.Ctx) error {
×
31
                id := c.Param("id")                         // Retrieve the 'id' parameter from the URL
×
32
                c.Set("Content-Type", "application/json")   // Set response content type as JSON
×
33
                return c.Status(200).SendString("Id:" + id) // Return the ID in the response
×
34
        })
×
35

36
        // Complex route with multiple parameters
37
        q.Get("/v1/userx/:p1/:p2/cust/:p3/:p4", func(c *quick.Ctx) error {
×
NEW
38
                c.Set("Content-Type", "application/json")           // Set response content type as JSON
×
NEW
39
                return c.Status(200).SendString("Quick in action!") // Return a success message
×
UNCOV
40
        })
×
41

42
        // Print all registered routes
43
        for k, v := range q.GetRoute() {
×
44
                fmt.Println(k, "[", v, "]")
×
45
        }
×
46

47
        // Start the server and listen on port 8080
48
        q.Listen(":8394")
×
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc