276 lines
9.9 KiB
Go
276 lines
9.9 KiB
Go
|
//COOPGO Diags gRPC service definition
|
||
|
|
||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||
|
// versions:
|
||
|
// - protoc-gen-go-grpc v1.5.1
|
||
|
// - protoc v3.21.12
|
||
|
// source: diags.proto
|
||
|
|
||
|
package grpcapi
|
||
|
|
||
|
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.64.0 or later.
|
||
|
const _ = grpc.SupportPackageIsVersion9
|
||
|
|
||
|
const (
|
||
|
Diags_CreateDiag_FullMethodName = "/Diags/CreateDiag"
|
||
|
Diags_GetDiag_FullMethodName = "/Diags/GetDiag"
|
||
|
Diags_GetDiags_FullMethodName = "/Diags/GetDiags"
|
||
|
Diags_DeleteDiag_FullMethodName = "/Diags/DeleteDiag"
|
||
|
Diags_UpdateDiag_FullMethodName = "/Diags/UpdateDiag"
|
||
|
)
|
||
|
|
||
|
// DiagsClient is the client API for Diags 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 DiagsClient interface {
|
||
|
CreateDiag(ctx context.Context, in *CreateDiagRequest, opts ...grpc.CallOption) (*CreateDiagResponse, error)
|
||
|
GetDiag(ctx context.Context, in *GetDiagRequest, opts ...grpc.CallOption) (*GetDiagResponse, error)
|
||
|
GetDiags(ctx context.Context, in *GetDiagsRequest, opts ...grpc.CallOption) (*GetDiagsResponse, error)
|
||
|
DeleteDiag(ctx context.Context, in *DeleteDiagRequest, opts ...grpc.CallOption) (*DeleteDiagResponse, error)
|
||
|
UpdateDiag(ctx context.Context, in *UpdateDiagRequest, opts ...grpc.CallOption) (*UpdateDiagResponse, error)
|
||
|
}
|
||
|
|
||
|
type diagsClient struct {
|
||
|
cc grpc.ClientConnInterface
|
||
|
}
|
||
|
|
||
|
func NewDiagsClient(cc grpc.ClientConnInterface) DiagsClient {
|
||
|
return &diagsClient{cc}
|
||
|
}
|
||
|
|
||
|
func (c *diagsClient) CreateDiag(ctx context.Context, in *CreateDiagRequest, opts ...grpc.CallOption) (*CreateDiagResponse, error) {
|
||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
out := new(CreateDiagResponse)
|
||
|
err := c.cc.Invoke(ctx, Diags_CreateDiag_FullMethodName, in, out, cOpts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
func (c *diagsClient) GetDiag(ctx context.Context, in *GetDiagRequest, opts ...grpc.CallOption) (*GetDiagResponse, error) {
|
||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
out := new(GetDiagResponse)
|
||
|
err := c.cc.Invoke(ctx, Diags_GetDiag_FullMethodName, in, out, cOpts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
func (c *diagsClient) GetDiags(ctx context.Context, in *GetDiagsRequest, opts ...grpc.CallOption) (*GetDiagsResponse, error) {
|
||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
out := new(GetDiagsResponse)
|
||
|
err := c.cc.Invoke(ctx, Diags_GetDiags_FullMethodName, in, out, cOpts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
func (c *diagsClient) DeleteDiag(ctx context.Context, in *DeleteDiagRequest, opts ...grpc.CallOption) (*DeleteDiagResponse, error) {
|
||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
out := new(DeleteDiagResponse)
|
||
|
err := c.cc.Invoke(ctx, Diags_DeleteDiag_FullMethodName, in, out, cOpts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
func (c *diagsClient) UpdateDiag(ctx context.Context, in *UpdateDiagRequest, opts ...grpc.CallOption) (*UpdateDiagResponse, error) {
|
||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
out := new(UpdateDiagResponse)
|
||
|
err := c.cc.Invoke(ctx, Diags_UpdateDiag_FullMethodName, in, out, cOpts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
// DiagsServer is the server API for Diags service.
|
||
|
// All implementations must embed UnimplementedDiagsServer
|
||
|
// for forward compatibility.
|
||
|
type DiagsServer interface {
|
||
|
CreateDiag(context.Context, *CreateDiagRequest) (*CreateDiagResponse, error)
|
||
|
GetDiag(context.Context, *GetDiagRequest) (*GetDiagResponse, error)
|
||
|
GetDiags(context.Context, *GetDiagsRequest) (*GetDiagsResponse, error)
|
||
|
DeleteDiag(context.Context, *DeleteDiagRequest) (*DeleteDiagResponse, error)
|
||
|
UpdateDiag(context.Context, *UpdateDiagRequest) (*UpdateDiagResponse, error)
|
||
|
mustEmbedUnimplementedDiagsServer()
|
||
|
}
|
||
|
|
||
|
// UnimplementedDiagsServer 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 UnimplementedDiagsServer struct{}
|
||
|
|
||
|
func (UnimplementedDiagsServer) CreateDiag(context.Context, *CreateDiagRequest) (*CreateDiagResponse, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method CreateDiag not implemented")
|
||
|
}
|
||
|
func (UnimplementedDiagsServer) GetDiag(context.Context, *GetDiagRequest) (*GetDiagResponse, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method GetDiag not implemented")
|
||
|
}
|
||
|
func (UnimplementedDiagsServer) GetDiags(context.Context, *GetDiagsRequest) (*GetDiagsResponse, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method GetDiags not implemented")
|
||
|
}
|
||
|
func (UnimplementedDiagsServer) DeleteDiag(context.Context, *DeleteDiagRequest) (*DeleteDiagResponse, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteDiag not implemented")
|
||
|
}
|
||
|
func (UnimplementedDiagsServer) UpdateDiag(context.Context, *UpdateDiagRequest) (*UpdateDiagResponse, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateDiag not implemented")
|
||
|
}
|
||
|
func (UnimplementedDiagsServer) mustEmbedUnimplementedDiagsServer() {}
|
||
|
func (UnimplementedDiagsServer) testEmbeddedByValue() {}
|
||
|
|
||
|
// UnsafeDiagsServer may be embedded to opt out of forward compatibility for this service.
|
||
|
// Use of this interface is not recommended, as added methods to DiagsServer will
|
||
|
// result in compilation errors.
|
||
|
type UnsafeDiagsServer interface {
|
||
|
mustEmbedUnimplementedDiagsServer()
|
||
|
}
|
||
|
|
||
|
func RegisterDiagsServer(s grpc.ServiceRegistrar, srv DiagsServer) {
|
||
|
// If the following call pancis, it indicates UnimplementedDiagsServer 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()
|
||
|
}
|
||
|
s.RegisterService(&Diags_ServiceDesc, srv)
|
||
|
}
|
||
|
|
||
|
func _Diags_CreateDiag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(CreateDiagRequest)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(DiagsServer).CreateDiag(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: Diags_CreateDiag_FullMethodName,
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(DiagsServer).CreateDiag(ctx, req.(*CreateDiagRequest))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
func _Diags_GetDiag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(GetDiagRequest)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(DiagsServer).GetDiag(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: Diags_GetDiag_FullMethodName,
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(DiagsServer).GetDiag(ctx, req.(*GetDiagRequest))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
func _Diags_GetDiags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(GetDiagsRequest)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(DiagsServer).GetDiags(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: Diags_GetDiags_FullMethodName,
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(DiagsServer).GetDiags(ctx, req.(*GetDiagsRequest))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
func _Diags_DeleteDiag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(DeleteDiagRequest)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(DiagsServer).DeleteDiag(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: Diags_DeleteDiag_FullMethodName,
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(DiagsServer).DeleteDiag(ctx, req.(*DeleteDiagRequest))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
func _Diags_UpdateDiag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(UpdateDiagRequest)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(DiagsServer).UpdateDiag(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: Diags_UpdateDiag_FullMethodName,
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(DiagsServer).UpdateDiag(ctx, req.(*UpdateDiagRequest))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
// Diags_ServiceDesc is the grpc.ServiceDesc for Diags service.
|
||
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
// and not to be introspected or modified (even as a copy)
|
||
|
var Diags_ServiceDesc = grpc.ServiceDesc{
|
||
|
ServiceName: "Diags",
|
||
|
HandlerType: (*DiagsServer)(nil),
|
||
|
Methods: []grpc.MethodDesc{
|
||
|
{
|
||
|
MethodName: "CreateDiag",
|
||
|
Handler: _Diags_CreateDiag_Handler,
|
||
|
},
|
||
|
{
|
||
|
MethodName: "GetDiag",
|
||
|
Handler: _Diags_GetDiag_Handler,
|
||
|
},
|
||
|
{
|
||
|
MethodName: "GetDiags",
|
||
|
Handler: _Diags_GetDiags_Handler,
|
||
|
},
|
||
|
{
|
||
|
MethodName: "DeleteDiag",
|
||
|
Handler: _Diags_DeleteDiag_Handler,
|
||
|
},
|
||
|
{
|
||
|
MethodName: "UpdateDiag",
|
||
|
Handler: _Diags_UpdateDiag_Handler,
|
||
|
},
|
||
|
},
|
||
|
Streams: []grpc.StreamDesc{},
|
||
|
Metadata: "diags.proto",
|
||
|
}
|