client rebuilding in progress
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user