mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-22 13:37:11 +02:00
initial commit - from neko open source repository..
This commit is contained in:
commit
56de805f54
66 changed files with 5498 additions and 0 deletions
12
internal/http/middleware/middleware.go
Normal file
12
internal/http/middleware/middleware.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package middleware
|
||||
|
||||
// contextKey is a value for use with context.WithValue. It's used as
|
||||
// a pointer so it fits in an interface{} without allocation. This technique
|
||||
// for defining context keys was copied from Go 1.7's new use of context in net/http.
|
||||
type ctxKey struct {
|
||||
name string
|
||||
}
|
||||
|
||||
func (k *ctxKey) String() string {
|
||||
return "neko/ctx/" + k.name
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue