github.com/lastbackend/toolkit@v0.0.0-20241020043710-cafa37b95aad/examples/http/gen/server/client/server.pb.toolkit.rpc.go (about) 1 // Code generated by protoc-gen-toolkit. DO NOT EDIT. 2 // source: github.com/lastbackend/toolkit/examples/http/apis/server.proto 3 4 package serverpb 5 6 import ( 7 context "context" 8 9 "github.com/lastbackend/toolkit/examples/http/gen/server" 10 client "github.com/lastbackend/toolkit/pkg/client" 11 emptypb "google.golang.org/protobuf/types/known/emptypb" 12 ) 13 14 // Suppress "imported and not used" errors 15 var _ context.Context 16 var _ emptypb.Empty 17 18 // Client gRPC API for Http service 19 func NewHttpRPCClient(service string, c client.GRPCClient) HttpRPCClient { 20 return &httpGrpcRPCClient{service, c} 21 } 22 23 // Client gRPC API for Http service 24 type HttpRPCClient interface { 25 HelloWorld(ctx context.Context, req *serverpb.HelloRequest, opts ...client.GRPCCallOption) (*serverpb.HelloResponse, error) 26 } 27 28 type httpGrpcRPCClient struct { 29 service string 30 cli client.GRPCClient 31 } 32 33 func (c *httpGrpcRPCClient) HelloWorld(ctx context.Context, req *serverpb.HelloRequest, opts ...client.GRPCCallOption) (*serverpb.HelloResponse, error) { 34 resp := new(serverpb.HelloResponse) 35 if err := c.cli.Call(ctx, c.service, Http_HelloWorldMethod, req, resp, opts...); err != nil { 36 return nil, err 37 } 38 return resp, nil 39 } 40 41 func (httpGrpcRPCClient) mustEmbedUnimplementedHttpClient() {} 42 43 // Client methods for Http service 44 const ( 45 Http_HelloWorldMethod = "/http.Http/HelloWorld" 46 )