client

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CallService

func CallService(appName, serviceMethod string, args, reply interface{}) bool

向微服务发送rpcx请求

func InitClient

func InitClient(rpcxClientConfig *RpcxClientConfig)

初始化微服务客户端参数

func NewEtcdV3Discovery

func NewEtcdV3Discovery(basePath string, servicePath string, etcdAddr []string, allowKeyNotFound bool, options *store.Config) (client.ServiceDiscovery, error)

NewEtcdV3Discovery returns a new EtcdV3Discovery.

func NewEtcdV3DiscoveryStore

func NewEtcdV3DiscoveryStore(basePath string, kv store.Store, allowKeyNotFound bool) (client.ServiceDiscovery, error)

NewEtcdV3DiscoveryStore return a new EtcdV3Discovery with specified store.

func NewEtcdV3DiscoveryTemplate

func NewEtcdV3DiscoveryTemplate(basePath string, etcdAddr []string, allowKeyNotFound bool, options *store.Config) (client.ServiceDiscovery, error)

NewEtcdV3DiscoveryTemplate returns a new EtcdV3Discovery template.

Types

type EtcdV3Discovery

type EtcdV3Discovery struct {

	// -1 means it always retry to watch until zookeeper is ok, 0 means no retry.
	RetriesAfterWatchFailed int

	AllowKeyNotFound bool
	// contains filtered or unexported fields
}

EtcdV3Discovery is a etcd service discovery. It always returns the registered servers in etcd.

func (*EtcdV3Discovery) Clone

func (d *EtcdV3Discovery) Clone(servicePath string) (client.ServiceDiscovery, error)

Clone clones this ServiceDiscovery with new servicePath.

func (*EtcdV3Discovery) Close

func (d *EtcdV3Discovery) Close()

func (*EtcdV3Discovery) GetServices

func (d *EtcdV3Discovery) GetServices() []*client.KVPair

GetServices returns the servers

func (*EtcdV3Discovery) RemoveWatcher

func (d *EtcdV3Discovery) RemoveWatcher(ch chan []*client.KVPair)

func (*EtcdV3Discovery) SetFilter

func (d *EtcdV3Discovery) SetFilter(filter client.ServiceDiscoveryFilter)

SetFilter sets the filer.

func (*EtcdV3Discovery) WatchService

func (d *EtcdV3Discovery) WatchService() chan []*client.KVPair

WatchService returns a nil chan.

type RpcxClientConfig

type RpcxClientConfig struct {
	BasePath   string   // /services/dev
	EtcdAddrss []string // etcd地址
	PoolSize   int      // 连接池

	FailMode   client.FailMode
	SelectMode client.SelectMode
	Option     client.Option
	Log        *log.Logger
	Options    *store.Config
}

Jump to

Keyboard shortcuts

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