discovery

package
v1.20.82 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: Zlib Imports: 9 Imported by: 0

README

服务发现

client 根据scheme区分 1 如果scheme同一个,在 reslover会保存最后一个,建议不要重复创建 2 如业务有多个需要,可以改变scheme定义自己

如果是连不同的机群,client请定义好scheme来区分

外面请求地址 // https://github.com/grpc/grpc/blob/master/doc/naming.md // scheme://authority//endpoints

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientUse added in v1.0.5

func ClientUse(key string, ncf NewClientFunc)

func NewClient added in v1.0.5

func NewClient(conf config.Config, points config.EndPoints, resolver resolver.Resolver) (service.Client, error)

func NewService added in v1.0.5

func NewService(cfg config.Config, points config.EndPoints, registry registry.Registry) (service.Service, error)

func ServiceUse added in v1.0.5

func ServiceUse(key string, nsf NewServiceFunc)

Types

type NewClientFunc added in v1.0.5

type NewClientFunc func(cfg config.Config, points config.EndPoints, resolver resolver.Resolver) (service.Client, error)

type NewServiceFunc added in v1.0.5

type NewServiceFunc func(cfg config.Config, points config.EndPoints, registry registry.Registry) (service.Service, error)

type Services

type Services struct {
	Services map[string]service.Base
	// contains filtered or unexported fields
}

func NewServices

func NewServices() *Services

func (*Services) Add

func (s *Services) Add(name string, base service.Base)

func (*Services) Del

func (s *Services) Del(name string)

func (*Services) Get

func (s *Services) Get(name string) (service.Base, bool)

Directories

Path Synopsis
*
*

Jump to

Keyboard shortcuts

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