use metadata.Metadata (#8)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit was merged in pull request #8.
This commit is contained in:
2020-11-18 16:50:41 +03:00
committed by GitHub
parent e0ef8b2953
commit daffa9e548
28 changed files with 119 additions and 84 deletions

View File

@@ -1,10 +1,10 @@
package wrapper
import (
"context"
"time"
"context"
"github.com/unistack-org/micro/v3/metadata"
"github.com/unistack-org/micro/v3/metrics"
"github.com/unistack-org/micro/v3/server"
)
@@ -26,9 +26,8 @@ func (w *Wrapper) HandlerFunc(handlerFunction server.HandlerFunc) server.Handler
return func(ctx context.Context, req server.Request, rsp interface{}) error {
// Build some tags to describe the call:
tags := metrics.Tags{
"method": req.Method(),
}
tags := metadata.New(2)
tags.Set("method", req.Method())
// Start the clock:
callTime := time.Now()