-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdoc.go
57 lines (57 loc) · 1.49 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Package helm is a simple, fast and minimalist router for writing web applications in Go. It builds on top of `net/http` and aims to be an elegant addition, by removing some of the cumbersome work involved with using the default `net/http` mux.
//
// For more information, see https://github.com/acmacalister/helm
//
// package main
//
// import (
// "fmt"
// "net/http"
//
// "github.com/acmacalister/helm"
// )
//
// type user struct {
// name string
// }
//
// type server struct {
// db string
// }
//
// func main() {
// //s := server{db: "austin you are awesome!"}
// // helm.NewStatic()
//
// r := helm.New(fallThrough) // Our fallthrough route.
// r.Use(log, auth) // add global/router level middleware to run on every route.
// r.Handle("GET", "/", root, blah)
// r.Run(":8080")
// }
//
// func log(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
// fmt.Println("Before")
// next(w, r)
// fmt.Println("After")
// }
//
// func auth(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
// fmt.Println("Do sweet auth stuff")
// next(w, r)
// }
//
// func blah(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
// fmt.Println("blah...")
// next(w, r)
// }
//
// func fallThrough(w http.ResponseWriter, r *http.Request) {
// http.Error(w, "You done messed up A-aron", http.StatusNotFound)
// }
//
// func root(w http.ResponseWriter, r *http.Request) {
// fmt.Println("root!")
// w.WriteHeader(200)
// w.Write([]byte("Root!"))
// }
package helm