|
|
@@ -33,7 +33,7 @@ func Context(ctx context.Context) Option {
|
|
|
|
|
|
// Namespace with registry namespace.
|
|
|
func Namespace(ns string) Option {
|
|
|
- return func(o *options) { o.namespace = fmt.Sprintf("/%s/naming", ns) }
|
|
|
+ return func(o *options) { o.namespace = ns }
|
|
|
}
|
|
|
|
|
|
// RegisterTTL with register ttl.
|
|
|
@@ -79,7 +79,7 @@ func New(client *clientv3.Client, opts ...Option) (r *Registry) {
|
|
|
|
|
|
// Register the registration.
|
|
|
func (r *Registry) Register(ctx context.Context, service *registry.ServiceInstance) error {
|
|
|
- key := fmt.Sprintf("%s/%s/%s", r.opts.namespace, service.Name, service.ID)
|
|
|
+ key := fmt.Sprintf("/%s/naming/%s/%s", r.opts.namespace, service.Name, service.ID)
|
|
|
value, err := marshal(service)
|
|
|
if err != nil {
|
|
|
return err
|