service

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

type Discovery interface {
	WatchService(path []string) error
	SetServiceList(key, val string)
	DelServiceList(key string)
	GetServices() []string
	Close() error
}

func NewServiceDiscovery

func NewServiceDiscovery(client *clientv3.Client) Discovery

NewServiceDiscovery 新建发现服务

type Register

type Register interface {
	ListenLeaseRespChan()
	Close() error
}

func NewServiceRegister

func NewServiceRegister(client *clientv3.Client, path []string, val string, ttl int64) (Register, error)

type ServiceDiscovery

type ServiceDiscovery struct {
	// contains filtered or unexported fields
}

ServiceDiscovery 服务发现

func (*ServiceDiscovery) Close

func (s *ServiceDiscovery) Close() error

Close 关闭服务

func (*ServiceDiscovery) DelServiceList

func (s *ServiceDiscovery) DelServiceList(key string)

DelServiceList 删除服务地址

func (*ServiceDiscovery) GetServices

func (s *ServiceDiscovery) GetServices() []string

GetServices 获取所有服务地址

func (*ServiceDiscovery) SetServiceList

func (s *ServiceDiscovery) SetServiceList(key, val string)

SetServiceList 新增服务地址

func (*ServiceDiscovery) WatchService

func (s *ServiceDiscovery) WatchService(path []string) error

WatchService 初始化服务列表和监视

type ServiceRegister

type ServiceRegister struct {
	// contains filtered or unexported fields
}

ServiceRegister 创建租约注册服务

func (*ServiceRegister) Close

func (s *ServiceRegister) Close() error

Close 注销服务

func (*ServiceRegister) ListenLeaseRespChan

func (s *ServiceRegister) ListenLeaseRespChan()

ListenLeaseRespChan 监听续租情况

Jump to

Keyboard shortcuts

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