Documentation ¶
Index ¶
- type ConsulDiscovery
- func (d *ConsulDiscovery) GetService(ctx context.Context, serviceName string) ([]*registry.ServiceInstance, error)
- func (d *ConsulDiscovery) ListServices() (allServices map[string][]*registry.ServiceInstance, err error)
- func (d *ConsulDiscovery) Service(ctx context.Context, service string, index uint64, passingOnly bool) ([]*registry.ServiceInstance, uint64, error)
- func (d *ConsulDiscovery) Watch(_ context.Context, serviceName string) (registry.Watcher, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsulDiscovery ¶
type ConsulDiscovery struct {
// contains filtered or unexported fields
}
func NewConsulDiscovery ¶
func NewConsulDiscovery(options *regOps.DiscoveryOptions) *ConsulDiscovery
func (*ConsulDiscovery) GetService ¶
func (d *ConsulDiscovery) GetService(ctx context.Context, serviceName string) ([]*registry.ServiceInstance, error)
GetService return service by name ,该方法主要用于第一次获取全量的服务对象,后期的增量标准是从watcher中获取
func (*ConsulDiscovery) ListServices ¶
func (d *ConsulDiscovery) ListServices() (allServices map[string][]*registry.ServiceInstance, err error)
ListServices return service list. ListServices 返回 所有服务的 列表
Click to show internal directories.
Click to hide internal directories.