initial commit

This commit is contained in:
2024-12-29 18:06:39 -05:00
commit fe4b5b6033
73 changed files with 9155 additions and 0 deletions

17
vendor/github.com/go-chi/chi/v5/middleware/value.go generated vendored Normal file
View File

@@ -0,0 +1,17 @@
package middleware
import (
"context"
"net/http"
)
// WithValue is a middleware that sets a given key/value in a context chain.
func WithValue(key, val interface{}) func(next http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
r = r.WithContext(context.WithValue(r.Context(), key, val))
next.ServeHTTP(w, r)
}
return http.HandlerFunc(fn)
}
}