Dealer/pkg/proto/services_grpc.pb.go

236 lines
9.4 KiB
Go
Raw Normal View History

2024-07-14 12:25:30 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
2024-08-01 06:05:23 +00:00
// - protoc-gen-go-grpc v1.5.1
2024-07-14 12:25:30 +00:00
// - protoc v5.27.1
// source: services.proto
package proto
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.
2024-08-01 06:05:23 +00:00
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ServiceDirectory_GetService_FullMethodName = "/proto.ServiceDirectory/GetService"
ServiceDirectory_ListService_FullMethodName = "/proto.ServiceDirectory/ListService"
ServiceDirectory_AddService_FullMethodName = "/proto.ServiceDirectory/AddService"
ServiceDirectory_RemoveService_FullMethodName = "/proto.ServiceDirectory/RemoveService"
)
2024-07-14 12:25:30 +00:00
// ServiceDirectoryClient is the client API for ServiceDirectory 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 ServiceDirectoryClient interface {
GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error)
ListService(ctx context.Context, in *ListServiceRequest, opts ...grpc.CallOption) (*ListServiceResponse, error)
AddService(ctx context.Context, in *ServiceInfo, opts ...grpc.CallOption) (*AddServiceResponse, error)
RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error)
}
type serviceDirectoryClient struct {
cc grpc.ClientConnInterface
}
func NewServiceDirectoryClient(cc grpc.ClientConnInterface) ServiceDirectoryClient {
return &serviceDirectoryClient{cc}
}
func (c *serviceDirectoryClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
2024-07-14 12:25:30 +00:00
out := new(GetServiceResponse)
err := c.cc.Invoke(ctx, ServiceDirectory_GetService_FullMethodName, in, out, cOpts...)
2024-07-14 12:25:30 +00:00
if err != nil {
return nil, err
}
return out, nil
}
func (c *serviceDirectoryClient) ListService(ctx context.Context, in *ListServiceRequest, opts ...grpc.CallOption) (*ListServiceResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
2024-07-14 12:25:30 +00:00
out := new(ListServiceResponse)
err := c.cc.Invoke(ctx, ServiceDirectory_ListService_FullMethodName, in, out, cOpts...)
2024-07-14 12:25:30 +00:00
if err != nil {
return nil, err
}
return out, nil
}
func (c *serviceDirectoryClient) AddService(ctx context.Context, in *ServiceInfo, opts ...grpc.CallOption) (*AddServiceResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
2024-07-14 12:25:30 +00:00
out := new(AddServiceResponse)
err := c.cc.Invoke(ctx, ServiceDirectory_AddService_FullMethodName, in, out, cOpts...)
2024-07-14 12:25:30 +00:00
if err != nil {
return nil, err
}
return out, nil
}
func (c *serviceDirectoryClient) RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
2024-07-14 12:25:30 +00:00
out := new(RemoveServiceResponse)
err := c.cc.Invoke(ctx, ServiceDirectory_RemoveService_FullMethodName, in, out, cOpts...)
2024-07-14 12:25:30 +00:00
if err != nil {
return nil, err
}
return out, nil
}
// ServiceDirectoryServer is the server API for ServiceDirectory service.
// All implementations must embed UnimplementedServiceDirectoryServer
2024-08-01 06:05:23 +00:00
// for forward compatibility.
2024-07-14 12:25:30 +00:00
type ServiceDirectoryServer interface {
GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error)
ListService(context.Context, *ListServiceRequest) (*ListServiceResponse, error)
AddService(context.Context, *ServiceInfo) (*AddServiceResponse, error)
RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error)
mustEmbedUnimplementedServiceDirectoryServer()
}
2024-08-01 06:05:23 +00:00
// UnimplementedServiceDirectoryServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedServiceDirectoryServer struct{}
2024-07-14 12:25:30 +00:00
func (UnimplementedServiceDirectoryServer) GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented")
}
func (UnimplementedServiceDirectoryServer) ListService(context.Context, *ListServiceRequest) (*ListServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListService not implemented")
}
func (UnimplementedServiceDirectoryServer) AddService(context.Context, *ServiceInfo) (*AddServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddService not implemented")
}
func (UnimplementedServiceDirectoryServer) RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveService not implemented")
}
func (UnimplementedServiceDirectoryServer) mustEmbedUnimplementedServiceDirectoryServer() {}
2024-08-01 06:05:23 +00:00
func (UnimplementedServiceDirectoryServer) testEmbeddedByValue() {}
2024-07-14 12:25:30 +00:00
// UnsafeServiceDirectoryServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ServiceDirectoryServer will
// result in compilation errors.
type UnsafeServiceDirectoryServer interface {
mustEmbedUnimplementedServiceDirectoryServer()
}
func RegisterServiceDirectoryServer(s grpc.ServiceRegistrar, srv ServiceDirectoryServer) {
2024-08-01 06:05:23 +00:00
// If the following call pancis, it indicates UnimplementedServiceDirectoryServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
2024-07-14 12:25:30 +00:00
s.RegisterService(&ServiceDirectory_ServiceDesc, srv)
}
func _ServiceDirectory_GetService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetServiceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ServiceDirectoryServer).GetService(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ServiceDirectory_GetService_FullMethodName,
2024-07-14 12:25:30 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServiceDirectoryServer).GetService(ctx, req.(*GetServiceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ServiceDirectory_ListService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListServiceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ServiceDirectoryServer).ListService(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ServiceDirectory_ListService_FullMethodName,
2024-07-14 12:25:30 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServiceDirectoryServer).ListService(ctx, req.(*ListServiceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ServiceDirectory_AddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ServiceInfo)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ServiceDirectoryServer).AddService(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ServiceDirectory_AddService_FullMethodName,
2024-07-14 12:25:30 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServiceDirectoryServer).AddService(ctx, req.(*ServiceInfo))
}
return interceptor(ctx, in, info, handler)
}
func _ServiceDirectory_RemoveService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RemoveServiceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ServiceDirectoryServer).RemoveService(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ServiceDirectory_RemoveService_FullMethodName,
2024-07-14 12:25:30 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServiceDirectoryServer).RemoveService(ctx, req.(*RemoveServiceRequest))
}
return interceptor(ctx, in, info, handler)
}
// ServiceDirectory_ServiceDesc is the grpc.ServiceDesc for ServiceDirectory service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ServiceDirectory_ServiceDesc = grpc.ServiceDesc{
ServiceName: "proto.ServiceDirectory",
HandlerType: (*ServiceDirectoryServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetService",
Handler: _ServiceDirectory_GetService_Handler,
},
{
MethodName: "ListService",
Handler: _ServiceDirectory_ListService_Handler,
},
{
MethodName: "AddService",
Handler: _ServiceDirectory_AddService_Handler,
},
{
MethodName: "RemoveService",
Handler: _ServiceDirectory_RemoveService_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "services.proto",
}