Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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
Click to show internal directories.
Click to hide internal directories.