first commit

This commit is contained in:
2024-03-29 11:40:39 +03:00
commit 1a1ce70a5c
62 changed files with 4080 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
package main
import (
"log"
"net/http"
"time"
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/timeout"
)
func emptySuccessResponse(c *gin.Context) {
time.Sleep(200 * time.Microsecond)
c.String(http.StatusOK, "")
}
func main() {
r := gin.New()
r.GET("/", timeout.New(
timeout.WithTimeout(100*time.Microsecond),
timeout.WithHandler(emptySuccessResponse),
))
// Listen and Server in 0.0.0.0:8080
if err := r.Run(":8080"); err != nil {
log.Fatal(err)
}
}