• 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.post/post.go
1
package main
2

3
import "github.com/jeffotoni/quick"
4

5
// Struct representing a user model
6
type My struct {
7
        Name string `json:"name"` // User's name
8
        Year int    `json:"year"` // User's birth year
9
}
10

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

×
NEW
14
        // Define a POST route at /v1/user
×
NEW
15
        q.Post("/v1/user", func(c *quick.Ctx) error {
×
NEW
16
                var my My // Create a variable to store incoming user data
×
NEW
17

×
NEW
18
                // Parse the request body into the struct
×
NEW
19
                err := c.BodyParser(&my)
×
NEW
20
                if err != nil {
×
NEW
21
                        // If parsing fails, return a 400 Bad Request response
×
NEW
22
                        return c.Status(400).SendString(err.Error())
×
NEW
23
                }
×
24

25
                // Return the parsed JSON data as a response with 200 OK
NEW
26
                return c.Status(200).JSON(&my)
×
27

28
                // Alternative:
29
                // return c.Status(200).String(c.BodyString())
30
                // Return raw request body as a string
31
        })
32

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