本文整理匯總了Golang中github.com/coreos/etcd/clientv3.Client.ActiveConnection方法的典型用法代碼示例。如果您正苦於以下問題:Golang Client.ActiveConnection方法的具體用法?Golang Client.ActiveConnection怎麽用?Golang Client.ActiveConnection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/coreos/etcd/clientv3.Client
的用法示例。
在下文中一共展示了Client.ActiveConnection方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: toGRPC
func toGRPC(c *clientv3.Client) grpcAPI {
return grpcAPI{
pb.NewClusterClient(c.ActiveConnection()),
pb.NewKVClient(c.ActiveConnection()),
pb.NewLeaseClient(c.ActiveConnection()),
pb.NewWatchClient(c.ActiveConnection()),
pb.NewMaintenanceClient(c.ActiveConnection()),
}
}
示例2: toGRPC
func toGRPC(c *clientv3.Client) grpcAPI {
if v, ok := proxies[c]; ok {
return v
}
return grpcAPI{
pb.NewClusterClient(c.ActiveConnection()),
grpcproxy.KvServerToKvClient(grpcproxy.NewKvProxy(c)),
pb.NewLeaseClient(c.ActiveConnection()),
grpcproxy.WatchServerToWatchClient(grpcproxy.NewWatchProxy(c)),
pb.NewMaintenanceClient(c.ActiveConnection()),
}
}
示例3: toGRPC
func toGRPC(c *clientv3.Client) grpcAPI {
pmu.Lock()
defer pmu.Unlock()
if v, ok := proxies[c]; ok {
return v
}
api := grpcAPI{
pb.NewClusterClient(c.ActiveConnection()),
grpcproxy.KvServerToKvClient(grpcproxy.NewKvProxy(c)),
pb.NewLeaseClient(c.ActiveConnection()),
grpcproxy.WatchServerToWatchClient(grpcproxy.NewWatchProxy(c)),
pb.NewMaintenanceClient(c.ActiveConnection()),
}
proxies[c] = api
return api
}