1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-12 08:23:58 +02:00
go-micro/plugins/config/source/url/options.go
2021-10-12 12:55:53 +01:00

19 lines
290 B
Go

package url
import (
"context"
"go-micro.dev/v4/config/source"
)
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)
}
}