github.com/ledgerwatch/erigon-lib@v1.0.0/direct/downloader_client.go (about) 1 /* 2 Copyright 2021 Erigon contributors 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package direct 18 19 import ( 20 "context" 21 22 proto_downloader "github.com/ledgerwatch/erigon-lib/gointerfaces/downloader" 23 "google.golang.org/grpc" 24 "google.golang.org/protobuf/types/known/emptypb" 25 ) 26 27 type DownloaderClient struct { 28 server proto_downloader.DownloaderServer 29 } 30 31 func NewDownloaderClient(server proto_downloader.DownloaderServer) *DownloaderClient { 32 return &DownloaderClient{server: server} 33 } 34 35 func (c *DownloaderClient) Download(ctx context.Context, in *proto_downloader.DownloadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { 36 return c.server.Download(ctx, in) 37 } 38 func (c *DownloaderClient) Verify(ctx context.Context, in *proto_downloader.VerifyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { 39 return c.server.Verify(ctx, in) 40 } 41 func (c *DownloaderClient) Stats(ctx context.Context, in *proto_downloader.StatsRequest, opts ...grpc.CallOption) (*proto_downloader.StatsReply, error) { 42 return c.server.Stats(ctx, in) 43 }