client rebuilding in progress

This commit is contained in:
2026-03-04 12:27:52 +02:00
parent 2d34ec5634
commit ae9c29de1e
31 changed files with 908 additions and 467 deletions
+6 -3
View File
@@ -15,6 +15,7 @@ import (
"encoding/json"
"io"
"net/http"
"net/url"
"strconv"
)
@@ -29,11 +30,10 @@ type Context struct {
}
func NewContext(writer http.ResponseWriter, request *http.Request) *Context {
ctx := context.Background()
rctx := &Context{
Writer: writer,
Request: request,
Ctx: ctx,
Ctx: request.Context(),
PathMap: make(map[string]string),
Bools: make(map[string]bool),
Strings: make(map[string]string),
@@ -66,6 +66,10 @@ func (rctx *Context) GetSubpath(key string) (string, bool) {
return value, exists
}
func (rctx *Context) URL() *url.URL {
return rctx.Request.URL
}
func (rctx *Context) GetQuery(key string) string {
return rctx.Request.URL.Query().Get(key)
}
@@ -83,7 +87,6 @@ func (rctx *Context) GetContext() context.Context {
}
// Binding
const emptyJSON = "{}"
func (rctx *Context) BindJSON(obj any) error {