client

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DynamicClient

func DynamicClient() *micro.Client

DynamicClient returns the common inner dynamic routing client.

func EtcdClient

func EtcdClient() *etcd.Client

EtcdClient returns the common ETCD client.

func Init

func Init(cliCfg micro.CliConfig, protoFunc socket.ProtoFunc, etcdClient *etcd.Client)

Init initializes a common inner tp-micro client.

func StaticClient

func StaticClient(srvAddr string) *micro.Client

StaticClient returns the client whose server address is srvAddr. If the client does not exist, set and return it.

Types

type StaticClients

type StaticClients struct {
	// contains filtered or unexported fields
}

StaticClients static clients map

func (*StaticClients) Get

func (s *StaticClients) Get(srvAddr string) (*micro.Client, bool)

Get returns the client whose server address is srvAddr.

func (*StaticClients) GetOrSet

func (s *StaticClients) GetOrSet(srvAddr string) *micro.Client

GetOrSet returns the client whose server address is srvAddr. If the client does not exist, set and return it.

func (*StaticClients) Set

func (s *StaticClients) Set(srvAddr string)

Set sets the client whose server address is srvAddr.

Jump to

Keyboard shortcuts

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