v3client: add example and godoc New

This commit is contained in:
Anthony Romano
2017-03-14 10:50:41 -07:00
parent 781196fa87
commit 01d1a579bc
2 changed files with 32 additions and 0 deletions

View File

@ -24,6 +24,9 @@ import (
"github.com/coreos/etcd/proxy/grpcproxy/adapter"
)
// New creates a clientv3 client that wraps an in-process EtcdServer. Instead
// of making gRPC calls through sockets, the client makes direct function calls
// to the etcd server through its api/v3rpc function interfaces.
func New(s *etcdserver.EtcdServer) *clientv3.Client {
c := clientv3.NewCtxClient(context.Background())