diff options
| author | Eltrac <hi@guhub.cn> | 2025-11-26 09:54:49 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-11-26 09:54:49 +0800 |
| commit | a555355d69a4fe9cd01d8bea86ce5b057cd1cd66 (patch) | |
| tree | ab3a4efaf52f88f5c72eda9e961407e77a60ba2f /context.go | |
| parent | 2f572636121a78c51b7188b7bd09965cb91c9dde (diff) | |
feat: implement minimal router
Diffstat (limited to 'context.go')
| -rw-r--r-- | context.go | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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), + }) +} |
