herald.go/protobuf/go/hub_grpc.pb.go

102 lines
3.1 KiB
Go
Raw Normal View History

2021-03-18 22:14:56 +01:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package pb
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
// HubClient is the client API for Hub 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 HubClient interface {
Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*Outputs, error)
2021-03-18 22:14:56 +01:00
}
type hubClient struct {
cc grpc.ClientConnInterface
}
func NewHubClient(cc grpc.ClientConnInterface) HubClient {
return &hubClient{cc}
}
func (c *hubClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*Outputs, error) {
out := new(Outputs)
2021-03-18 22:14:56 +01:00
err := c.cc.Invoke(ctx, "/pb.Hub/Search", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// HubServer is the server API for Hub service.
// All implementations must embed UnimplementedHubServer
// for forward compatibility
type HubServer interface {
Search(context.Context, *SearchRequest) (*Outputs, error)
2021-03-18 22:14:56 +01:00
mustEmbedUnimplementedHubServer()
}
// UnimplementedHubServer must be embedded to have forward compatible implementations.
type UnimplementedHubServer struct {
}
func (UnimplementedHubServer) Search(context.Context, *SearchRequest) (*Outputs, error) {
2021-03-18 22:14:56 +01:00
return nil, status.Errorf(codes.Unimplemented, "method Search not implemented")
}
func (UnimplementedHubServer) mustEmbedUnimplementedHubServer() {}
// UnsafeHubServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to HubServer will
// result in compilation errors.
type UnsafeHubServer interface {
mustEmbedUnimplementedHubServer()
}
func RegisterHubServer(s grpc.ServiceRegistrar, srv HubServer) {
s.RegisterService(&Hub_ServiceDesc, srv)
}
func _Hub_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SearchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HubServer).Search(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Hub/Search",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HubServer).Search(ctx, req.(*SearchRequest))
}
return interceptor(ctx, in, info, handler)
}
// Hub_ServiceDesc is the grpc.ServiceDesc for Hub service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Hub_ServiceDesc = grpc.ServiceDesc{
ServiceName: "pb.Hub",
HandlerType: (*HubServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Search",
Handler: _Hub_Search_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "hub.proto",
}