1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-03-03 15:22:30 +02:00

19 lines
302 B
Go
Raw Normal View History

2020-12-26 15:32:45 +00:00
package url
import (
"context"
2021-01-20 21:01:10 +00:00
"github.com/asim/go-micro/v3/config/source"
2020-12-26 15:32:45 +00:00
)
type urlKey struct{}
func WithURL(u string) source.Option {
return func(o *source.Options) {
if o.Context == nil {
o.Context = context.Background()
}
o.Context = context.WithValue(o.Context, urlKey{}, u)
}
}