Skip to main content
Version: Next

abstractServiceDiscovery <Client, ServiceDiscoveryConfigOptions, RegisterServiceInstance, QueryServiceInstance, GetInstanceOptions>

服务发现抽象类

Index

Constructors

constructor

  • new ServiceDiscovery<Client, ServiceDiscoveryConfigOptions, RegisterServiceInstance, QueryServiceInstance, GetInstanceOptions>(): ServiceDiscovery<Client, ServiceDiscoveryConfigOptions, RegisterServiceInstance, QueryServiceInstance, GetInstanceOptions>
  • Type parameters

    • Client
    • ServiceDiscoveryConfigOptions: ServiceDiscoveryOptions<QueryServiceInstance, Record<string, any>>
    • RegisterServiceInstance
    • QueryServiceInstance = RegisterServiceInstance
    • GetInstanceOptions = RegisterServiceInstance

Methods

publiccreateClient

publicgetInstance

  • getInstance(options: GetInstanceOptions): Promise<QueryServiceInstance>
  • 获取一个可用服务实例(带负载均衡)

publicabstractgetInstances

  • getInstances(options: GetInstanceOptions): Promise<QueryServiceInstance[]>
  • 获取可用服务列表

publicsetLoadBalancer

  • 设置负载均衡策略