mirror of
https://github.com/owncloud/ocis
synced 2026-04-25 17:25:21 +02:00
* walk and log chi routes, ocs cleanup Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * make linter happy Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
24 lines
429 B
Go
24 lines
429 B
Go
package svc
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/owncloud/ocis/v2/ocis-pkg/middleware"
|
|
)
|
|
|
|
// NewTracing returns a service that instruments traces.
|
|
func NewTracing(next Service) Service {
|
|
return tracing{
|
|
next: next,
|
|
}
|
|
}
|
|
|
|
type tracing struct {
|
|
next Service
|
|
}
|
|
|
|
// ServeHTTP implements the Service interface.
|
|
func (t tracing) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
middleware.TraceContext(t.next).ServeHTTP(w, r)
|
|
}
|