Move wrapper internally since its not top level relevant
This commit is contained in:
13
service.go
13
service.go
@@ -12,9 +12,9 @@ import (
|
||||
"github.com/micro/go-micro/debug/handler"
|
||||
"github.com/micro/go-micro/debug/profile"
|
||||
"github.com/micro/go-micro/debug/profile/pprof"
|
||||
"github.com/micro/go-micro/metadata"
|
||||
"github.com/micro/go-micro/plugin"
|
||||
"github.com/micro/go-micro/server"
|
||||
"github.com/micro/go-micro/util/wrapper"
|
||||
"github.com/micro/go-micro/util/log"
|
||||
)
|
||||
|
||||
@@ -27,12 +27,11 @@ type service struct {
|
||||
func newService(opts ...Option) Service {
|
||||
options := newOptions(opts...)
|
||||
|
||||
options.Client = &clientWrapper{
|
||||
options.Client,
|
||||
metadata.Metadata{
|
||||
HeaderPrefix + "From-Service": options.Server.Options().Name,
|
||||
},
|
||||
}
|
||||
// service name
|
||||
serviceName := options.Server.Options().Name
|
||||
|
||||
// wrap client to inject From-Service header on any calls
|
||||
options.Client = wrapper.FromService(serviceName, options.Client)
|
||||
|
||||
return &service{
|
||||
opts: options,
|
||||
|
Reference in New Issue
Block a user