From 55d7b2e3129ee09fefb929c288a19370bf83bdc9 Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Thu, 2 Nov 2023 20:50:25 +0800 Subject: [PATCH] update sd interface --- sd/sd.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sd/sd.go b/sd/sd.go index 71da211..24f29df 100644 --- a/sd/sd.go +++ b/sd/sd.go @@ -9,16 +9,17 @@ type Options struct{} type Option func(opts *Options) type Service struct { - Node string + ID string Name string + Node string Network string Address string } // SD is the service discovery interface. type SD interface { - Register(ctx context.Context, name string, network string, address string, opts ...Option) error - Deregister(ctx context.Context, name string) error - Renew(ctx context.Context, name string) error + Register(ctx context.Context, service *Service, opts ...Option) error + Deregister(ctx context.Context, service *Service) error + Renew(ctx context.Context, service *Service) error Get(ctx context.Context, name string) ([]*Service, error) }