Documentation ¶
Index ¶
- func AuthenticationMiddleware(adminToken string, idv *identity.Validator, enforcer *casbin.Enforcer) func(http.Handler) http.Handler
- func Log(ctx context.Context) *zap.Logger
- func LogFromRequest(r *http.Request) *zap.Logger
- func Logger() func(next http.Handler) http.Handler
- func Messaging(next http.Handler) http.Handler
- func Metrics(next http.Handler) http.Handler
- func Paging(defaultLimit uint64) func(next http.Handler) http.Handler
- func RequestID(next http.Handler) http.Handler
- func RequestLogger(f LogConstructor) func(next http.Handler) http.Handler
- func SetupMiddleware(r chi.Router, timeout time.Duration)
- func WithLogEntry(r *http.Request, entry LogWriter) *http.Request
- type LogConstructor
- type LogEntry
- type LogWriter
- type LogWriterConstructor
- type MetricsProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticationMiddleware ¶ added in v1.7.25
func RequestID ¶
RequestID is a middleware that injects a request ID into the context of each request. A request ID is a string of the form "host.example.com/random-0001", where "random" is a base62 random string that uniquely identifies this go process, and where the last number is an atomically incremented request counter.
func RequestLogger ¶
func RequestLogger(f LogConstructor) func(next http.Handler) http.Handler
Types ¶
type LogConstructor ¶
type LogWriterConstructor ¶
type LogWriterConstructor struct {
// contains filtered or unexported fields
}
func (*LogWriterConstructor) NewLogWriter ¶
func (l *LogWriterConstructor) NewLogWriter(r *http.Request) LogWriter
type MetricsProvider ¶
type MetricsProvider interface { }
Click to show internal directories.
Click to hide internal directories.