consul

package
v0.0.0-...-157c77b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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 返回 所有服务的 列表

func (*ConsulDiscovery) Service

func (d *ConsulDiscovery) Service(ctx context.Context, service string, index uint64, passingOnly bool) ([]*registry.ServiceInstance, uint64, error)

Service get services from consul

func (*ConsulDiscovery) Watch

func (d *ConsulDiscovery) Watch(_ context.Context, serviceName string) (registry.Watcher, error)

Watch 获取一个增量的监听器

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL