sjcsjc123 commented on issue #122:
URL: 
https://github.com/apache/dubbo-kubernetes/issues/122#issuecomment-1868507914

   初步接口如下,是否有需要修改的或者补充的
   ```go
   // Registry 是注册中心的接口
   type Registry interface {
        // ListServices 列出所有服务名
        ListServices(ctx *context.Context) ([]string, error)
        // ListInstances 列出指定服务名的所有实例
        ListInstances(ctx *context.Context, serviceName string) ([]string, 
error)
        // GetRouteRule 获取指定服务名已生效的路由规则
        GetRouteRule(ctx *context.Context, serviceName string) (Rule, error)
        // SetRouteRule 设置指定服务名的路由规则
        SetRouteRule(ctx *context.Context, serviceName string, rule Rule) error
        // RegisterService 注册服务
        RegisterService(ctx *context.Context, service Service) error
        // UnregisterService 注销服务
        UnregisterService(ctx *context.Context, service Service) error
        // GetServiceByRule 根据路由规则获取服务
        GetServiceByRule(ctx *context.Context, serviceName string, rule Rule) 
(Service, error)
   }
   
   type Rule interface {
        // GetConfigVersion 获取配置版本号
        GetConfigVersion(ctx *context.Context) string
        // GetRuleType 获取路由规则类型
        GetRuleType(ctx *context.Context) string
        // GetRouteRule 获取路由规则
        GetRouteRule(ctx *context.Context) string
        // SetRouteRule 设置路由规则,有条件路由\标签路由\脚本路由\动态配置路由
        SetRouteRule(ctx *context.Context, rule interface{}) error
   }
   
   type Service struct {
        Ip   string
        Port int
        // 更多字段
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to