Exemple #1
0
    def __init__(self, addr='localhost:9080', credentials=None, options=None):
        if credentials is None:
            self.channel = grpc.insecure_channel(addr, options)
        else:
            self.channel = grpc.secure_channel(addr, credentials, options)

        self.stub = api_grpc.DgraphStub(self.channel)
Exemple #2
0
 def __init__(self, host, port):
     self.channel = grpc.insecure_channel("{host}:{port}".format(host=host,
                                                                 port=port))
     self._stub = api_grpc.DgraphStub(self.channel)
     self._lin_read = api.LinRead()