Documentation
¶
Index ¶
- type Client
- type RPCPlatform
- func (p *RPCPlatform) Lookup(ctx context.Context, name string, watch bool) (<-chan map[string]*serverinfo.ServerInfo, error)
- func (p *RPCPlatform) NewClient(target string, options ...func(*config.Client)) (*Client, error)
- func (p *RPCPlatform) NewServer(name, addr string, options ...func(*config.Server)) (*Server, error)
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Client ¶
func (c *Client) Client() *grpc.ClientConn
Client return the original gRPC ClientConn object.
type RPCPlatform ¶
type RPCPlatform struct {
// contains filtered or unexported fields
}
func New ¶
func New(etcdPrefix string, etcdClient *etcd.Client, options ...func(*config.Platform)) (*RPCPlatform, error)
New creates an RPCPlatform object for further creation of clients and servers. All methods of this object are thread safe. You can create this object once and use it in different places in your program.
func (*RPCPlatform) Lookup ¶ added in v1.4.0
func (p *RPCPlatform) Lookup(ctx context.Context, name string, watch bool) (<-chan map[string]*serverinfo.ServerInfo, error)
Lookup returns information about available servers by name. If the watch is set to true, a new portion of data will be provided with each change. Otherwise the channel will be closed immediately after the first data is written. The keys of the returned map are server IDs.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.