You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
3.5 KiB
102 lines
3.5 KiB
3 years ago
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||
|
|
||
|
package v1
|
||
|
|
||
|
import (
|
||
|
context "context"
|
||
|
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.
|
||
|
// Requires gRPC-Go v1.32.0 or later.
|
||
|
const _ = grpc.SupportPackageIsVersion7
|
||
|
|
||
|
// ExampleServiceClient is the client API for ExampleService 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 ExampleServiceClient interface {
|
||
|
TestValidate(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error)
|
||
|
}
|
||
|
|
||
|
type exampleServiceClient struct {
|
||
|
cc grpc.ClientConnInterface
|
||
|
}
|
||
|
|
||
|
func NewExampleServiceClient(cc grpc.ClientConnInterface) ExampleServiceClient {
|
||
|
return &exampleServiceClient{cc}
|
||
|
}
|
||
|
|
||
|
func (c *exampleServiceClient) TestValidate(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error) {
|
||
|
out := new(Reply)
|
||
|
err := c.cc.Invoke(ctx, "/api.example.ExampleService/TestValidate", in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
// ExampleServiceServer is the server API for ExampleService service.
|
||
|
// All implementations must embed UnimplementedExampleServiceServer
|
||
|
// for forward compatibility
|
||
|
type ExampleServiceServer interface {
|
||
|
TestValidate(context.Context, *Request) (*Reply, error)
|
||
|
mustEmbedUnimplementedExampleServiceServer()
|
||
|
}
|
||
|
|
||
|
// UnimplementedExampleServiceServer must be embedded to have forward compatible implementations.
|
||
|
type UnimplementedExampleServiceServer struct {
|
||
|
}
|
||
|
|
||
|
func (UnimplementedExampleServiceServer) TestValidate(context.Context, *Request) (*Reply, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method TestValidate not implemented")
|
||
|
}
|
||
|
func (UnimplementedExampleServiceServer) mustEmbedUnimplementedExampleServiceServer() {}
|
||
|
|
||
|
// UnsafeExampleServiceServer may be embedded to opt out of forward compatibility for this service.
|
||
|
// Use of this interface is not recommended, as added methods to ExampleServiceServer will
|
||
|
// result in compilation errors.
|
||
|
type UnsafeExampleServiceServer interface {
|
||
|
mustEmbedUnimplementedExampleServiceServer()
|
||
|
}
|
||
|
|
||
|
func RegisterExampleServiceServer(s grpc.ServiceRegistrar, srv ExampleServiceServer) {
|
||
|
s.RegisterService(&ExampleService_ServiceDesc, srv)
|
||
|
}
|
||
|
|
||
|
func _ExampleService_TestValidate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(Request)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(ExampleServiceServer).TestValidate(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: "/api.example.ExampleService/TestValidate",
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(ExampleServiceServer).TestValidate(ctx, req.(*Request))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
// ExampleService_ServiceDesc is the grpc.ServiceDesc for ExampleService service.
|
||
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
// and not to be introspected or modified (even as a copy)
|
||
|
var ExampleService_ServiceDesc = grpc.ServiceDesc{
|
||
|
ServiceName: "api.example.ExampleService",
|
||
|
HandlerType: (*ExampleServiceServer)(nil),
|
||
|
Methods: []grpc.MethodDesc{
|
||
|
{
|
||
|
MethodName: "TestValidate",
|
||
|
Handler: _ExampleService_TestValidate_Handler,
|
||
|
},
|
||
|
},
|
||
|
Streams: []grpc.StreamDesc{},
|
||
|
Metadata: "example.proto",
|
||
|
}
|