Files
grpccanary/protoapi/protoapi_grpc.pb.go
T

198 lines
7.3 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v5.27.2
// source: examples/grpcentity/protoapi.proto
package protoapi
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 (
IoTService_GetDate_FullMethodName = "/IoTService/GetDate"
IoTService_UpdateSensingData_FullMethodName = "/IoTService/UpdateSensingData"
IoTService_GetRandomPass_FullMethodName = "/IoTService/GetRandomPass"
)
// IoTServiceClient is the client API for IoTService 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 IoTServiceClient interface {
GetDate(ctx context.Context, in *RequestDateTime, opts ...grpc.CallOption) (*DateTime, error)
UpdateSensingData(ctx context.Context, in *SensingData, opts ...grpc.CallOption) (*SensingResponse, error)
GetRandomPass(ctx context.Context, in *RequestPass, opts ...grpc.CallOption) (*RandomPass, error)
}
type ioTServiceClient struct {
cc grpc.ClientConnInterface
}
func NewIoTServiceClient(cc grpc.ClientConnInterface) IoTServiceClient {
return &ioTServiceClient{cc}
}
func (c *ioTServiceClient) GetDate(ctx context.Context, in *RequestDateTime, opts ...grpc.CallOption) (*DateTime, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DateTime)
err := c.cc.Invoke(ctx, IoTService_GetDate_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *ioTServiceClient) UpdateSensingData(ctx context.Context, in *SensingData, opts ...grpc.CallOption) (*SensingResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SensingResponse)
err := c.cc.Invoke(ctx, IoTService_UpdateSensingData_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *ioTServiceClient) GetRandomPass(ctx context.Context, in *RequestPass, opts ...grpc.CallOption) (*RandomPass, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RandomPass)
err := c.cc.Invoke(ctx, IoTService_GetRandomPass_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// IoTServiceServer is the server API for IoTService service.
// All implementations must embed UnimplementedIoTServiceServer
// for forward compatibility.
type IoTServiceServer interface {
GetDate(context.Context, *RequestDateTime) (*DateTime, error)
UpdateSensingData(context.Context, *SensingData) (*SensingResponse, error)
GetRandomPass(context.Context, *RequestPass) (*RandomPass, error)
mustEmbedUnimplementedIoTServiceServer()
}
// UnimplementedIoTServiceServer 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 UnimplementedIoTServiceServer struct{}
func (UnimplementedIoTServiceServer) GetDate(context.Context, *RequestDateTime) (*DateTime, error) {
return nil, status.Error(codes.Unimplemented, "method GetDate not implemented")
}
func (UnimplementedIoTServiceServer) UpdateSensingData(context.Context, *SensingData) (*SensingResponse, error) {
return nil, status.Error(codes.Unimplemented, "method UpdateSensingData not implemented")
}
func (UnimplementedIoTServiceServer) GetRandomPass(context.Context, *RequestPass) (*RandomPass, error) {
return nil, status.Error(codes.Unimplemented, "method GetRandomPass not implemented")
}
func (UnimplementedIoTServiceServer) mustEmbedUnimplementedIoTServiceServer() {}
func (UnimplementedIoTServiceServer) testEmbeddedByValue() {}
// UnsafeIoTServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to IoTServiceServer will
// result in compilation errors.
type UnsafeIoTServiceServer interface {
mustEmbedUnimplementedIoTServiceServer()
}
func RegisterIoTServiceServer(s grpc.ServiceRegistrar, srv IoTServiceServer) {
// If the following call panics, it indicates UnimplementedIoTServiceServer 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(&IoTService_ServiceDesc, srv)
}
func _IoTService_GetDate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RequestDateTime)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IoTServiceServer).GetDate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IoTService_GetDate_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IoTServiceServer).GetDate(ctx, req.(*RequestDateTime))
}
return interceptor(ctx, in, info, handler)
}
func _IoTService_UpdateSensingData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SensingData)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IoTServiceServer).UpdateSensingData(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IoTService_UpdateSensingData_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IoTServiceServer).UpdateSensingData(ctx, req.(*SensingData))
}
return interceptor(ctx, in, info, handler)
}
func _IoTService_GetRandomPass_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RequestPass)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IoTServiceServer).GetRandomPass(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IoTService_GetRandomPass_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IoTServiceServer).GetRandomPass(ctx, req.(*RequestPass))
}
return interceptor(ctx, in, info, handler)
}
// IoTService_ServiceDesc is the grpc.ServiceDesc for IoTService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var IoTService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "IoTService",
HandlerType: (*IoTServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetDate",
Handler: _IoTService_GetDate_Handler,
},
{
MethodName: "UpdateSensingData",
Handler: _IoTService_UpdateSensingData_Handler,
},
{
MethodName: "GetRandomPass",
Handler: _IoTService_GetRandomPass_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "examples/grpcentity/protoapi.proto",
}