summaryrefslogtreecommitdiff
path: root/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'context.go')
-rw-r--r--context.go20
1 files changed, 20 insertions, 0 deletions
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),
+ })
+}