middleware/types.go

20 lines
415 B
Go
Raw Normal View History

2020-11-07 11:59:33 +00:00
package middleware
import (
"net/http"
)
// ResponseHandle is a function that middleware call in case of stop chain
type ResponseHandle func(w http.ResponseWriter, r *http.Request, err error)
// CtxKey is a key to use with context.WithValue
type CtxKey struct {
Pkg string
Name string
}
// String returns string representation
func (s *CtxKey) String() string {
return s.Pkg + " context value " + s.Name
}