1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-03-23 20:32:32 +02:00
go-micro/config/source/mucp/options.go

19 lines
321 B
Go
Raw Normal View History

2020-01-17 00:10:15 +08:00
package mucp
import (
"context"
"github.com/micro/go-micro/config/source"
)
type serviceNameKey struct{}
func ServiceName(a string) source.Option {
return func(o *source.Options) {
if o.Context == nil {
o.Context = context.Background()
}
o.Context = context.WithValue(o.Context, serviceNameKey{}, a)
}
}