grpc/proto/hello_grpc_grpc.pb.go (72 lines of code) (raw):
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package proto
import (
context "context"
)
import (
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion7
// UserProviderClient is the client API for UserProvider service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type UserProviderClient interface {
GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error)
}
type userProviderClient struct {
cc grpc.ClientConnInterface
}
func NewUserProviderClient(cc grpc.ClientConnInterface) UserProviderClient {
return &userProviderClient{cc}
}
func (c *userProviderClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) {
out := new(GetUserResponse)
err := c.cc.Invoke(ctx, "/provider.UserProvider/GetUser", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// UserProviderServer is the server API for UserProvider service.
// All implementations must embed UnimplementedUserProviderServer
// for forward compatibility
type UserProviderServer interface {
GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
mustEmbedUnimplementedUserProviderServer()
}
// UnimplementedUserProviderServer must be embedded to have forward compatible implementations.
type UnimplementedUserProviderServer struct {
}
func (UnimplementedUserProviderServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")
}
func (UnimplementedUserProviderServer) mustEmbedUnimplementedUserProviderServer() {}
// UnsafeUserProviderServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UserProviderServer will
// result in compilation errors.
type UnsafeUserProviderServer interface {
mustEmbedUnimplementedUserProviderServer()
}
func RegisterUserProviderServer(s *grpc.Server, srv UserProviderServer) {
s.RegisterService(&_UserProvider_serviceDesc, srv)
}
func _UserProvider_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserProviderServer).GetUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/provider.UserProvider/GetUser",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserProviderServer).GetUser(ctx, req.(*GetUserRequest))
}
return interceptor(ctx, in, info, handler)
}
var _UserProvider_serviceDesc = grpc.ServiceDesc{
ServiceName: "provider.UserProvider",
HandlerType: (*UserProviderServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetUser",
Handler: _UserProvider_GetUser_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "hello_grpc.proto",
}