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

jeffotoni / quick / 214

04 Mar 2025 07:11AM UTC coverage: 49.209% (-26.0%) from 75.221%
214

push

circleci

jeffotoni
Merge branch 'feature/refactory_http_client'

new version http client

32 of 1275 new or added lines in 44 files covered. (2.51%)

15 existing lines in 1 file now uncovered.

1803 of 3664 relevant lines covered (49.21%)

2724.12 hits per line

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

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

3
import (
4
        "fmt"
5

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

NEW
9
func main() {
×
NEW
10
        q := quick.New() // Initialize Quick framework
×
NEW
11

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

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

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

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

38
        // Print all registered routes
NEW
39
        for k, v := range q.GetRoute() {
×
NEW
40
                fmt.Println(k, "[", v, "]")
×
NEW
41
        }
×
42

43
        // Start the server and listen on port 8080
NEW
44
        q.Listen("0.0.0.0:8080")
×
45
}
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