mirror of
https://github.com/go-kratos/kratos.git
synced 2026-05-22 10:15:24 +02:00
Revert/root ctx v2 (#1088)
* Revert "remove app info (#1081)"
This reverts commit 1dab58616b.
* add http base ctx
Co-authored-by: longXboy <longxboyhi@gmail.com>
This commit is contained in:
@@ -32,7 +32,8 @@ func (s *server) SayHello(ctx context.Context, in *helloworld.HelloRequest) (*he
|
||||
if md, ok := metadata.FromServerContext(ctx); ok {
|
||||
extra = md.Get("x-md-global-extra")
|
||||
}
|
||||
return &helloworld.HelloReply{Message: fmt.Sprintf("Hello %s and %s", in.Name, extra)}, nil
|
||||
info, _ := kratos.FromContext(ctx)
|
||||
return &helloworld.HelloReply{Message: fmt.Sprintf("Hello %s extra: %s name: %s", in.Name, extra, info.Name())}, nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
Reference in New Issue
Block a user