rpc

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 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
	BuildTarget(string) string
	NoBlock() bool
	TimeOut() int
	MustNewDiscovery() register.IDiscovery
}

type ClientConf

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

func (*ClientConf) BuildTarget added in v0.1.10

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

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

func (*ClientConf) MustNewDiscovery

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

MustNewDiscovery new 一个 Discovery

func (*ClientConf) NoBlock added in v0.1.4

func (c *ClientConf) NoBlock() bool

func (*ClientConf) TimeOut added in v0.1.4

func (c *ClientConf) TimeOut() int

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