Move context to metadata

This commit is contained in:
Asim
2016-01-28 17:55:28 +00:00
parent cd9801891e
commit 9ae0956cea
13 changed files with 60 additions and 60 deletions

View File

@@ -2,8 +2,8 @@ package handler
import (
log "github.com/golang/glog"
c "github.com/micro/go-micro/context"
example "github.com/micro/go-micro/examples/server/proto/example"
"github.com/micro/go-micro/metadata"
"github.com/micro/go-micro/server"
"golang.org/x/net/context"
@@ -12,7 +12,7 @@ import (
type Example struct{}
func (e *Example) Call(ctx context.Context, req *example.Request, rsp *example.Response) error {
md, _ := c.GetMetadata(ctx)
md, _ := metadata.FromContext(ctx)
log.Infof("Received Example.Call request with metadata: %v", md)
rsp.Msg = server.DefaultOptions().Id + ": Hello " + req.Name
return nil