mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-26 05:58:27 -05:00
29 lines
550 B
Go
29 lines
550 B
Go
package svc
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/owncloud/ocis/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.Trace(t.next).ServeHTTP(w, r)
|
|
}
|
|
|
|
// Dummy implements the Service interface.
|
|
func (t tracing) Dummy(w http.ResponseWriter, r *http.Request) {
|
|
t.next.Dummy(w, r)
|
|
}
|