Documentation ¶
Index ¶
- func GetDefaultLogger(serviceName, environment string) *logrus.Entry
- func GetLoggerFromContext(ctx context.Context) *logrus.Entry
- func HandlerFunc(h func(w http.ResponseWriter, r *http.Request) error) http.Handler
- func NoCache(h http.Handler) http.Handler
- func Recovery(h http.Handler) http.Handler
- func RequestID(h http.Handler) http.Handler
- func UserIDInjector(h http.Handler) http.Handler
- type Logger
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultLogger ¶
GetDefaultLogger gets a default logger to use
func GetLoggerFromContext ¶
GetLoggerFromContext returns a logrus entry from the context, defaulting to a standard one if its not found
func HandlerFunc ¶
HandlerFunc converts a handler with an error to a standard handler
func NoCache ¶
NoCache will add the following headers to the response:
Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: 0
Types ¶
type Timer ¶
type Timer interface {
Time(name string) alice.Constructor
}
Timer can time a handler and log it
func NewNullTimer ¶
func NewNullTimer() Timer
Click to show internal directories.
Click to hide internal directories.