Skip to content

Commit f466068

Browse files
authored
Added Go Pine framework (#9358)
1 parent 1975428 commit f466068

File tree

6 files changed

+82
-0
lines changed

6 files changed

+82
-0
lines changed

frameworks/Go/pine/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Pine Benchmarking Test
2+
3+
## Test URLs
4+
5+
### JSON
6+
7+
http://localhost:8080/json
8+
9+
### PLAINTEXT
10+
11+
http://localhost:8080/plaintext
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"framework": "pine",
3+
"tests": [
4+
{
5+
"default": {
6+
"json_url": "/json",
7+
"plaintext_url": "/plaintext",
8+
"port": 8080,
9+
"approach": "Realistic",
10+
"classification": "Micro",
11+
"database": "None",
12+
"framework": "Pine",
13+
"language": "Go",
14+
"flavor": "None",
15+
"orm": "None",
16+
"platform": "None",
17+
"webserver": "None",
18+
"os": "Linux",
19+
"database_os": "Linux",
20+
"display_name": "Pine",
21+
"notes": "",
22+
"versus": "go"
23+
}
24+
}
25+
]
26+
}

frameworks/Go/pine/pine.dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM docker.io/golang:1.23
2+
3+
COPY ./src /pine
4+
WORKDIR /pine
5+
6+
RUN go mod download
7+
8+
EXPOSE 8080
9+
10+
CMD go run .

frameworks/Go/pine/src/go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module pine
2+
3+
go 1.23.0
4+
5+
require github.com/BryanMwangi/pine v1.0.6

frameworks/Go/pine/src/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/BryanMwangi/pine v1.0.6 h1:35JN1FQkStoCikeVQJ2423mO5STLNEPkA/AgnjslAmg=
2+
github.com/BryanMwangi/pine v1.0.6/go.mod h1:j6+gT+N2HeeJHc9Z60rUOnEmNC+s/Gdmh2e9oB/eScI=

frameworks/Go/pine/src/main.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package main
2+
3+
import (
4+
"log"
5+
6+
"github.com/BryanMwangi/pine"
7+
)
8+
9+
func plaintextHandler(c *pine.Ctx) error {
10+
c.Set("Server", "Pine")
11+
return c.SendString("Hello, World!")
12+
}
13+
14+
func jsonHandler(c *pine.Ctx) error {
15+
c.Set("Server", "Pine")
16+
return c.JSON(map[string]string{
17+
"message": "Hello, World!",
18+
})
19+
}
20+
21+
func main() {
22+
app := pine.New()
23+
app.Get("/plaintext", plaintextHandler)
24+
app.Get("/json", jsonHandler)
25+
26+
// Start the server on port 3000
27+
log.Fatal(app.Start(":8080"))
28+
}

0 commit comments

Comments
 (0)