serverregistrydiscover

package
v0.0.0-...-15722f1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultEtcdConfig = clientv3.Config{
		Endpoints:   []string{"localhost:2379"},
		DialTimeout: 5 * time.Second,
	}
)

register 模块提供服务注册至 etcd 的能力

Functions

func EtcdDial

func EtcdDial(c *clientv3.Client, service string) (*grpc.ClientConn, error)

EtcdDial 向 grpc 请求一个服务 通过提供一个 etcd client 和 service name 即可获取连接

func Register

func Register(service string, addr string, stop chan error) error

Register 注册一个服务至 etcd 注意 Register 将不会 return(如果没有 error 的话)

Types

This section is empty.

Jump to

Keyboard shortcuts

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