diff options
| author | Eltrac <hi@guhub.cn> | 2025-11-27 11:31:35 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-11-27 11:31:35 +0800 |
| commit | bb58f6cd1d9cce5b12e2f9a30b1c9a6aaefdd54c (patch) | |
| tree | 8a668165b0f0f57c4fc10a462cf22f2cdbdf5954 /types.go | |
| parent | a13c9a7abe43e9e3f21799e8be161422c7fad5a4 (diff) | |
refactor: move type definitions to types.go also, rename Api to Engine.
Diffstat (limited to 'types.go')
| -rw-r--r-- | types.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/types.go b/types.go new file mode 100644 index 0000000..e785f4c --- /dev/null +++ b/types.go @@ -0,0 +1,25 @@ +package growel + +import "net/http" + +type Context struct { + W http.ResponseWriter + R *http.Request + Params map[string]string +} + +type Handler func(c *Context) + +type Route struct { + method string + parts []string + handler Handler +} + +type Router struct { + routes []Route +} + +type Engine struct { + router *Router +} |
