647 lines
26 KiB
Go
647 lines
26 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.2
|
|
// - protoc v3.21.12
|
|
// source: api/shack.proto
|
|
|
|
package api
|
|
|
|
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 (
|
|
AuthService_Login_FullMethodName = "/api.AuthService/Login"
|
|
)
|
|
|
|
// AuthServiceClient is the client API for AuthService 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 AuthServiceClient interface {
|
|
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
|
|
}
|
|
|
|
type authServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
|
|
return &authServiceClient{cc}
|
|
}
|
|
|
|
func (c *authServiceClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(LoginResponse)
|
|
err := c.cc.Invoke(ctx, AuthService_Login_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// AuthServiceServer is the server API for AuthService service.
|
|
// All implementations must embed UnimplementedAuthServiceServer
|
|
// for forward compatibility.
|
|
type AuthServiceServer interface {
|
|
Login(context.Context, *LoginRequest) (*LoginResponse, error)
|
|
mustEmbedUnimplementedAuthServiceServer()
|
|
}
|
|
|
|
// UnimplementedAuthServiceServer 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 UnimplementedAuthServiceServer struct{}
|
|
|
|
func (UnimplementedAuthServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method Login not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
|
|
func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to AuthServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeAuthServiceServer interface {
|
|
mustEmbedUnimplementedAuthServiceServer()
|
|
}
|
|
|
|
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedAuthServiceServer 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(&AuthService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _AuthService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(LoginRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).Login(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AuthService_Login_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).Login(ctx, req.(*LoginRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var AuthService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "api.AuthService",
|
|
HandlerType: (*AuthServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Login",
|
|
Handler: _AuthService_Login_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "api/shack.proto",
|
|
}
|
|
|
|
const (
|
|
RigService_OperatorSession_FullMethodName = "/api.RigService/OperatorSession"
|
|
RigService_MonitorSession_FullMethodName = "/api.RigService/MonitorSession"
|
|
)
|
|
|
|
// RigServiceClient is the client API for RigService 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 RigServiceClient interface {
|
|
OperatorSession(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[RigCommand, RigStatus], error)
|
|
MonitorSession(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RigStatus], error)
|
|
}
|
|
|
|
type rigServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewRigServiceClient(cc grpc.ClientConnInterface) RigServiceClient {
|
|
return &rigServiceClient{cc}
|
|
}
|
|
|
|
func (c *rigServiceClient) OperatorSession(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[RigCommand, RigStatus], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &RigService_ServiceDesc.Streams[0], RigService_OperatorSession_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[RigCommand, RigStatus]{ClientStream: stream}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type RigService_OperatorSessionClient = grpc.BidiStreamingClient[RigCommand, RigStatus]
|
|
|
|
func (c *rigServiceClient) MonitorSession(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RigStatus], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &RigService_ServiceDesc.Streams[1], RigService_MonitorSession_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[Empty, RigStatus]{ClientStream: stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type RigService_MonitorSessionClient = grpc.ServerStreamingClient[RigStatus]
|
|
|
|
// RigServiceServer is the server API for RigService service.
|
|
// All implementations must embed UnimplementedRigServiceServer
|
|
// for forward compatibility.
|
|
type RigServiceServer interface {
|
|
OperatorSession(grpc.BidiStreamingServer[RigCommand, RigStatus]) error
|
|
MonitorSession(*Empty, grpc.ServerStreamingServer[RigStatus]) error
|
|
mustEmbedUnimplementedRigServiceServer()
|
|
}
|
|
|
|
// UnimplementedRigServiceServer 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 UnimplementedRigServiceServer struct{}
|
|
|
|
func (UnimplementedRigServiceServer) OperatorSession(grpc.BidiStreamingServer[RigCommand, RigStatus]) error {
|
|
return status.Error(codes.Unimplemented, "method OperatorSession not implemented")
|
|
}
|
|
func (UnimplementedRigServiceServer) MonitorSession(*Empty, grpc.ServerStreamingServer[RigStatus]) error {
|
|
return status.Error(codes.Unimplemented, "method MonitorSession not implemented")
|
|
}
|
|
func (UnimplementedRigServiceServer) mustEmbedUnimplementedRigServiceServer() {}
|
|
func (UnimplementedRigServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeRigServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to RigServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeRigServiceServer interface {
|
|
mustEmbedUnimplementedRigServiceServer()
|
|
}
|
|
|
|
func RegisterRigServiceServer(s grpc.ServiceRegistrar, srv RigServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedRigServiceServer 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(&RigService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _RigService_OperatorSession_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(RigServiceServer).OperatorSession(&grpc.GenericServerStream[RigCommand, RigStatus]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type RigService_OperatorSessionServer = grpc.BidiStreamingServer[RigCommand, RigStatus]
|
|
|
|
func _RigService_MonitorSession_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(Empty)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(RigServiceServer).MonitorSession(m, &grpc.GenericServerStream[Empty, RigStatus]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type RigService_MonitorSessionServer = grpc.ServerStreamingServer[RigStatus]
|
|
|
|
// RigService_ServiceDesc is the grpc.ServiceDesc for RigService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var RigService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "api.RigService",
|
|
HandlerType: (*RigServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "OperatorSession",
|
|
Handler: _RigService_OperatorSession_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
{
|
|
StreamName: "MonitorSession",
|
|
Handler: _RigService_MonitorSession_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "api/shack.proto",
|
|
}
|
|
|
|
const (
|
|
RotorService_TargetPosition_FullMethodName = "/api.RotorService/TargetPosition"
|
|
RotorService_LivePosition_FullMethodName = "/api.RotorService/LivePosition"
|
|
)
|
|
|
|
// RotorServiceClient is the client API for RotorService 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 RotorServiceClient interface {
|
|
TargetPosition(ctx context.Context, in *RotorTarget, opts ...grpc.CallOption) (*Empty, error)
|
|
LivePosition(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RotorStatus], error)
|
|
}
|
|
|
|
type rotorServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewRotorServiceClient(cc grpc.ClientConnInterface) RotorServiceClient {
|
|
return &rotorServiceClient{cc}
|
|
}
|
|
|
|
func (c *rotorServiceClient) TargetPosition(ctx context.Context, in *RotorTarget, opts ...grpc.CallOption) (*Empty, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Empty)
|
|
err := c.cc.Invoke(ctx, RotorService_TargetPosition_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *rotorServiceClient) LivePosition(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RotorStatus], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &RotorService_ServiceDesc.Streams[0], RotorService_LivePosition_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[Empty, RotorStatus]{ClientStream: stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type RotorService_LivePositionClient = grpc.ServerStreamingClient[RotorStatus]
|
|
|
|
// RotorServiceServer is the server API for RotorService service.
|
|
// All implementations must embed UnimplementedRotorServiceServer
|
|
// for forward compatibility.
|
|
type RotorServiceServer interface {
|
|
TargetPosition(context.Context, *RotorTarget) (*Empty, error)
|
|
LivePosition(*Empty, grpc.ServerStreamingServer[RotorStatus]) error
|
|
mustEmbedUnimplementedRotorServiceServer()
|
|
}
|
|
|
|
// UnimplementedRotorServiceServer 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 UnimplementedRotorServiceServer struct{}
|
|
|
|
func (UnimplementedRotorServiceServer) TargetPosition(context.Context, *RotorTarget) (*Empty, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method TargetPosition not implemented")
|
|
}
|
|
func (UnimplementedRotorServiceServer) LivePosition(*Empty, grpc.ServerStreamingServer[RotorStatus]) error {
|
|
return status.Error(codes.Unimplemented, "method LivePosition not implemented")
|
|
}
|
|
func (UnimplementedRotorServiceServer) mustEmbedUnimplementedRotorServiceServer() {}
|
|
func (UnimplementedRotorServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeRotorServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to RotorServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeRotorServiceServer interface {
|
|
mustEmbedUnimplementedRotorServiceServer()
|
|
}
|
|
|
|
func RegisterRotorServiceServer(s grpc.ServiceRegistrar, srv RotorServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedRotorServiceServer 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(&RotorService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _RotorService_TargetPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RotorTarget)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(RotorServiceServer).TargetPosition(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: RotorService_TargetPosition_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(RotorServiceServer).TargetPosition(ctx, req.(*RotorTarget))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _RotorService_LivePosition_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(Empty)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(RotorServiceServer).LivePosition(m, &grpc.GenericServerStream[Empty, RotorStatus]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type RotorService_LivePositionServer = grpc.ServerStreamingServer[RotorStatus]
|
|
|
|
// RotorService_ServiceDesc is the grpc.ServiceDesc for RotorService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var RotorService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "api.RotorService",
|
|
HandlerType: (*RotorServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "TargetPosition",
|
|
Handler: _RotorService_TargetPosition_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "LivePosition",
|
|
Handler: _RotorService_LivePosition_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "api/shack.proto",
|
|
}
|
|
|
|
const (
|
|
RelaisService_SetRelais_FullMethodName = "/api.RelaisService/SetRelais"
|
|
RelaisService_GetRelaisState_FullMethodName = "/api.RelaisService/GetRelaisState"
|
|
)
|
|
|
|
// RelaisServiceClient is the client API for RelaisService 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 RelaisServiceClient interface {
|
|
SetRelais(ctx context.Context, in *RelaisRequest, opts ...grpc.CallOption) (*RelaisResponse, error)
|
|
GetRelaisState(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*RelaisResponse, error)
|
|
}
|
|
|
|
type relaisServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewRelaisServiceClient(cc grpc.ClientConnInterface) RelaisServiceClient {
|
|
return &relaisServiceClient{cc}
|
|
}
|
|
|
|
func (c *relaisServiceClient) SetRelais(ctx context.Context, in *RelaisRequest, opts ...grpc.CallOption) (*RelaisResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(RelaisResponse)
|
|
err := c.cc.Invoke(ctx, RelaisService_SetRelais_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *relaisServiceClient) GetRelaisState(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*RelaisResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(RelaisResponse)
|
|
err := c.cc.Invoke(ctx, RelaisService_GetRelaisState_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// RelaisServiceServer is the server API for RelaisService service.
|
|
// All implementations must embed UnimplementedRelaisServiceServer
|
|
// for forward compatibility.
|
|
type RelaisServiceServer interface {
|
|
SetRelais(context.Context, *RelaisRequest) (*RelaisResponse, error)
|
|
GetRelaisState(context.Context, *Empty) (*RelaisResponse, error)
|
|
mustEmbedUnimplementedRelaisServiceServer()
|
|
}
|
|
|
|
// UnimplementedRelaisServiceServer 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 UnimplementedRelaisServiceServer struct{}
|
|
|
|
func (UnimplementedRelaisServiceServer) SetRelais(context.Context, *RelaisRequest) (*RelaisResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method SetRelais not implemented")
|
|
}
|
|
func (UnimplementedRelaisServiceServer) GetRelaisState(context.Context, *Empty) (*RelaisResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetRelaisState not implemented")
|
|
}
|
|
func (UnimplementedRelaisServiceServer) mustEmbedUnimplementedRelaisServiceServer() {}
|
|
func (UnimplementedRelaisServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeRelaisServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to RelaisServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeRelaisServiceServer interface {
|
|
mustEmbedUnimplementedRelaisServiceServer()
|
|
}
|
|
|
|
func RegisterRelaisServiceServer(s grpc.ServiceRegistrar, srv RelaisServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedRelaisServiceServer 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(&RelaisService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _RelaisService_SetRelais_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RelaisRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(RelaisServiceServer).SetRelais(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: RelaisService_SetRelais_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(RelaisServiceServer).SetRelais(ctx, req.(*RelaisRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _RelaisService_GetRelaisState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(RelaisServiceServer).GetRelaisState(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: RelaisService_GetRelaisState_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(RelaisServiceServer).GetRelaisState(ctx, req.(*Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// RelaisService_ServiceDesc is the grpc.ServiceDesc for RelaisService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var RelaisService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "api.RelaisService",
|
|
HandlerType: (*RelaisServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "SetRelais",
|
|
Handler: _RelaisService_SetRelais_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetRelaisState",
|
|
Handler: _RelaisService_GetRelaisState_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "api/shack.proto",
|
|
}
|
|
|
|
const (
|
|
TelemetryService_StreamVoltages_FullMethodName = "/api.TelemetryService/StreamVoltages"
|
|
)
|
|
|
|
// TelemetryServiceClient is the client API for TelemetryService 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 TelemetryServiceClient interface {
|
|
StreamVoltages(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[VoltageResponse], error)
|
|
}
|
|
|
|
type telemetryServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewTelemetryServiceClient(cc grpc.ClientConnInterface) TelemetryServiceClient {
|
|
return &telemetryServiceClient{cc}
|
|
}
|
|
|
|
func (c *telemetryServiceClient) StreamVoltages(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[VoltageResponse], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &TelemetryService_ServiceDesc.Streams[0], TelemetryService_StreamVoltages_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[Empty, VoltageResponse]{ClientStream: stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type TelemetryService_StreamVoltagesClient = grpc.ServerStreamingClient[VoltageResponse]
|
|
|
|
// TelemetryServiceServer is the server API for TelemetryService service.
|
|
// All implementations must embed UnimplementedTelemetryServiceServer
|
|
// for forward compatibility.
|
|
type TelemetryServiceServer interface {
|
|
StreamVoltages(*Empty, grpc.ServerStreamingServer[VoltageResponse]) error
|
|
mustEmbedUnimplementedTelemetryServiceServer()
|
|
}
|
|
|
|
// UnimplementedTelemetryServiceServer 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 UnimplementedTelemetryServiceServer struct{}
|
|
|
|
func (UnimplementedTelemetryServiceServer) StreamVoltages(*Empty, grpc.ServerStreamingServer[VoltageResponse]) error {
|
|
return status.Error(codes.Unimplemented, "method StreamVoltages not implemented")
|
|
}
|
|
func (UnimplementedTelemetryServiceServer) mustEmbedUnimplementedTelemetryServiceServer() {}
|
|
func (UnimplementedTelemetryServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeTelemetryServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to TelemetryServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeTelemetryServiceServer interface {
|
|
mustEmbedUnimplementedTelemetryServiceServer()
|
|
}
|
|
|
|
func RegisterTelemetryServiceServer(s grpc.ServiceRegistrar, srv TelemetryServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedTelemetryServiceServer 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(&TelemetryService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _TelemetryService_StreamVoltages_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(Empty)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(TelemetryServiceServer).StreamVoltages(m, &grpc.GenericServerStream[Empty, VoltageResponse]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type TelemetryService_StreamVoltagesServer = grpc.ServerStreamingServer[VoltageResponse]
|
|
|
|
// TelemetryService_ServiceDesc is the grpc.ServiceDesc for TelemetryService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var TelemetryService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "api.TelemetryService",
|
|
HandlerType: (*TelemetryServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "StreamVoltages",
|
|
Handler: _TelemetryService_StreamVoltages_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "api/shack.proto",
|
|
}
|