rpc

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	HasEtcd() bool
	GetTarget(string) string
	MustNewDiscovery() register.IDiscovery
}

type ClientConf

type ClientConf struct {
	configure.EtcdConf `yaml:"Etcd"`
	NonBlock           bool   `yaml:"NonBlock"`
	Model              string `yaml:"Model"`
}

func (*ClientConf) GetTarget

func (c *ClientConf) GetTarget(serverName string) string

GetTarget 返回一个用来做服务发现的 target

func (*ClientConf) MustNewDiscovery

func (c *ClientConf) MustNewDiscovery() register.IDiscovery

MustNewDiscovery new 一个 Discovery

type Server

type Server interface {
	HasEtcd() bool
	GetNamespace() string
	GetServiceName() string
	GetEndpoint() string
	MustNewRegister() register.IRegister
}

type ServerConf

type ServerConf struct {
	configure.EtcdConf `yaml:"Etcd"`
	ServerName         string `yaml:"ServerName"`
	Endpoint           string `yaml:"Endpoint"`
	Model              string `yaml:"Model"`
}

func (*ServerConf) GetEndpoint

func (s *ServerConf) GetEndpoint() string

GetEndpoint 返回服务的监听IP与PORT

func (*ServerConf) GetNamespace

func (s *ServerConf) GetNamespace() string

GetNamespace 返回 namespace

func (*ServerConf) GetServiceName

func (s *ServerConf) GetServiceName() string

GetServiceName 返回服务名

func (*ServerConf) MustNewRegister

func (s *ServerConf) MustNewRegister() register.IRegister

MustNewRegister new 一个注册器

Jump to

Keyboard shortcuts

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