From a555355d69a4fe9cd01d8bea86ce5b057cd1cd66 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Wed, 26 Nov 2025 09:54:49 +0800 Subject: feat: implement minimal router --- context.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'context.go') diff --git a/context.go b/context.go index aa10769..fbb6a1e 100644 --- a/context.go +++ b/context.go @@ -1 +1,21 @@ package growel + +import ( + "net/http" +) + +type Context struct { + W http.ResponseWriter + R http.Request + Params map[string]string +} + +type Handler func(c *Context) + +func (h Handler) ServeHTTP(w http.ResponseWriter, r http.Request) { + h(&Context{ + W: w, + R: r, + Params: make(map[string]string), + }) +} -- cgit v1.2.3