registerdiscovery

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 7 Imported by: 1

README

registerdiscovery

Documentation

Index

Constants

View Source
const Version = "v0.0.6"

Variables

This section is empty.

Functions

func RegisterResolver added in v0.0.2

func RegisterResolver(client *clientv3.Client)

func RegisterService

func RegisterService(ctx context.Context, service, address string, client *clientv3.Client) error

ctx 可控制租约

func ServiceName2Key

func ServiceName2Key(name string) string

func SetEtcdClient

func SetEtcdClient(client *clientv3.Client)

Types

type EtcdResolverBuilder

type EtcdResolverBuilder struct{}

func (*EtcdResolverBuilder) Build

func (*EtcdResolverBuilder) Scheme

func (*EtcdResolverBuilder) Scheme() string

type ServiceDiscovery

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

func NewServiceDiscovery

func NewServiceDiscovery(client *clientv3.Client) *ServiceDiscovery

func (*ServiceDiscovery) DiscoverServices

func (sd *ServiceDiscovery) DiscoverServices(servicename string) ([]string, error)

func (*ServiceDiscovery) WatchServices

func (sd *ServiceDiscovery) WatchServices(ctx context.Context, servicename string) <-chan struct{}

Jump to

Keyboard shortcuts

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