registry

package
v0.0.0-...-fc18315 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Even

type Even struct {
	Type string
}

type Registry

type Registry interface {
	// Register 将grpc服务器注册到注册中心
	Register(ctx context.Context, si ServiceInstance) error
	UnRegister(ctx context.Context, si ServiceInstance) error

	// ListService 根据serviceName获取可用的服务实例
	ListService(ctx context.Context, serviceName string) ([]ServiceInstance, error)
	SubScribe(serviceName string) (<-chan Even, error)

	io.Closer
}

type ServiceInstance

type ServiceInstance struct {
	Name    string //grpc 服务器名称
	Address string //grpc 服务器地址
	Tag     string //grpc 服务器标签
	Weight  int    //grpc 服务器权重
}

func NewServiceInstance

func NewServiceInstance(viper *viper.Viper) ServiceInstance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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