github.com/binkynet/BinkyNet@v1.12.1-0.20240421190447-da4e34c20be0/apis/v1/commandstation.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: commandstation.proto
     3  
     4  package v1
     5  
     6  import (
     7  	context "context"
     8  	fmt "fmt"
     9  	proto "github.com/golang/protobuf/proto"
    10  	grpc "google.golang.org/grpc"
    11  	codes "google.golang.org/grpc/codes"
    12  	status "google.golang.org/grpc/status"
    13  	math "math"
    14  )
    15  
    16  // Reference imports to suppress errors if they are not otherwise used.
    17  var _ = proto.Marshal
    18  var _ = fmt.Errorf
    19  var _ = math.Inf
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the proto package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // proto package needs to be updated.
    25  const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
    26  
    27  func init() { proto.RegisterFile("commandstation.proto", fileDescriptor_2383d9124325f33a) }
    28  
    29  var fileDescriptor_2383d9124325f33a = []byte{
    30  	// 229 bytes of a gzipped FileDescriptorProto
    31  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x49, 0xce, 0xcf, 0xcd,
    32  	0x4d, 0xcc, 0x4b, 0x29, 0x2e, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9,
    33  	0x17, 0xe2, 0x4e, 0xca, 0xcc, 0xcb, 0xae, 0xcc, 0x4b, 0x2d, 0xd1, 0x2b, 0x33, 0x94, 0xe2, 0x2e,
    34  	0xa9, 0x2c, 0x48, 0x2d, 0x86, 0xc8, 0x18, 0x1d, 0x64, 0xe4, 0x12, 0x75, 0x86, 0x68, 0x09, 0x86,
    35  	0x68, 0x09, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0x15, 0xb2, 0xe3, 0x62, 0x77, 0x4f, 0x2d, 0xf1,
    36  	0xcc, 0x4b, 0xcb, 0x17, 0x12, 0xd2, 0x43, 0xd2, 0xaf, 0xe7, 0x9a, 0x5b, 0x50, 0x52, 0x29, 0x25,
    37  	0x8f, 0x22, 0x86, 0x6a, 0x04, 0x58, 0x93, 0x05, 0x17, 0x6b, 0x40, 0x7e, 0x79, 0x6a, 0x91, 0x90,
    38  	0x38, 0x8a, 0x4a, 0xb0, 0x18, 0x48, 0x5d, 0xaa, 0x94, 0x10, 0xa6, 0x84, 0x06, 0xa3, 0x01, 0xa3,
    39  	0x90, 0x1e, 0x17, 0x8b, 0x4f, 0x7e, 0x72, 0xb1, 0x90, 0x00, 0x8a, 0xbc, 0x4f, 0x7e, 0xb2, 0x14,
    40  	0x86, 0x08, 0x48, 0xbd, 0x93, 0xe7, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78,
    41  	0x24, 0xc7, 0x38, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x4a, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e,
    42  	0x72, 0x7e, 0xae, 0x3e, 0x4c, 0x87, 0xbe, 0x13, 0x88, 0xe1, 0x97, 0x5a, 0xa2, 0x9f, 0x58, 0x90,
    43  	0x59, 0xac, 0x5f, 0x66, 0xb8, 0x8a, 0x49, 0x00, 0x26, 0xa4, 0xe7, 0x58, 0x90, 0x59, 0xac, 0x17,
    44  	0x66, 0x98, 0xc4, 0x06, 0x0e, 0x15, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x66, 0x99, 0x87,
    45  	0x81, 0x47, 0x01, 0x00, 0x00,
    46  }
    47  
    48  // Reference imports to suppress errors if they are not otherwise used.
    49  var _ context.Context
    50  var _ grpc.ClientConn
    51  
    52  // This is a compile-time assertion to ensure that this generated file
    53  // is compatible with the grpc package it is being compiled against.
    54  const _ = grpc.SupportPackageIsVersion4
    55  
    56  // CommandStationServiceClient is the client API for CommandStationService service.
    57  //
    58  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
    59  type CommandStationServiceClient interface {
    60  	// GetInfo returns information from the command station.
    61  	GetInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CommandStationInfo, error)
    62  	// Power is used to send power requests and receive power request & actual changes.
    63  	Power(ctx context.Context, opts ...grpc.CallOption) (CommandStationService_PowerClient, error)
    64  	// Locs is used to control locs and get changes in loc requests & actual state back.
    65  	// Note: Loc.actual on incoming objects is ignored.
    66  	Locs(ctx context.Context, opts ...grpc.CallOption) (CommandStationService_LocsClient, error)
    67  }
    68  
    69  type commandStationServiceClient struct {
    70  	cc *grpc.ClientConn
    71  }
    72  
    73  func NewCommandStationServiceClient(cc *grpc.ClientConn) CommandStationServiceClient {
    74  	return &commandStationServiceClient{cc}
    75  }
    76  
    77  func (c *commandStationServiceClient) GetInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CommandStationInfo, error) {
    78  	out := new(CommandStationInfo)
    79  	err := c.cc.Invoke(ctx, "/binkynet.v1.CommandStationService/GetInfo", in, out, opts...)
    80  	if err != nil {
    81  		return nil, err
    82  	}
    83  	return out, nil
    84  }
    85  
    86  func (c *commandStationServiceClient) Power(ctx context.Context, opts ...grpc.CallOption) (CommandStationService_PowerClient, error) {
    87  	stream, err := c.cc.NewStream(ctx, &_CommandStationService_serviceDesc.Streams[0], "/binkynet.v1.CommandStationService/Power", opts...)
    88  	if err != nil {
    89  		return nil, err
    90  	}
    91  	x := &commandStationServicePowerClient{stream}
    92  	return x, nil
    93  }
    94  
    95  type CommandStationService_PowerClient interface {
    96  	Send(*PowerState) error
    97  	Recv() (*Power, error)
    98  	grpc.ClientStream
    99  }
   100  
   101  type commandStationServicePowerClient struct {
   102  	grpc.ClientStream
   103  }
   104  
   105  func (x *commandStationServicePowerClient) Send(m *PowerState) error {
   106  	return x.ClientStream.SendMsg(m)
   107  }
   108  
   109  func (x *commandStationServicePowerClient) Recv() (*Power, error) {
   110  	m := new(Power)
   111  	if err := x.ClientStream.RecvMsg(m); err != nil {
   112  		return nil, err
   113  	}
   114  	return m, nil
   115  }
   116  
   117  func (c *commandStationServiceClient) Locs(ctx context.Context, opts ...grpc.CallOption) (CommandStationService_LocsClient, error) {
   118  	stream, err := c.cc.NewStream(ctx, &_CommandStationService_serviceDesc.Streams[1], "/binkynet.v1.CommandStationService/Locs", opts...)
   119  	if err != nil {
   120  		return nil, err
   121  	}
   122  	x := &commandStationServiceLocsClient{stream}
   123  	return x, nil
   124  }
   125  
   126  type CommandStationService_LocsClient interface {
   127  	Send(*Loc) error
   128  	Recv() (*Loc, error)
   129  	grpc.ClientStream
   130  }
   131  
   132  type commandStationServiceLocsClient struct {
   133  	grpc.ClientStream
   134  }
   135  
   136  func (x *commandStationServiceLocsClient) Send(m *Loc) error {
   137  	return x.ClientStream.SendMsg(m)
   138  }
   139  
   140  func (x *commandStationServiceLocsClient) Recv() (*Loc, error) {
   141  	m := new(Loc)
   142  	if err := x.ClientStream.RecvMsg(m); err != nil {
   143  		return nil, err
   144  	}
   145  	return m, nil
   146  }
   147  
   148  // CommandStationServiceServer is the server API for CommandStationService service.
   149  type CommandStationServiceServer interface {
   150  	// GetInfo returns information from the command station.
   151  	GetInfo(context.Context, *Empty) (*CommandStationInfo, error)
   152  	// Power is used to send power requests and receive power request & actual changes.
   153  	Power(CommandStationService_PowerServer) error
   154  	// Locs is used to control locs and get changes in loc requests & actual state back.
   155  	// Note: Loc.actual on incoming objects is ignored.
   156  	Locs(CommandStationService_LocsServer) error
   157  }
   158  
   159  // UnimplementedCommandStationServiceServer can be embedded to have forward compatible implementations.
   160  type UnimplementedCommandStationServiceServer struct {
   161  }
   162  
   163  func (*UnimplementedCommandStationServiceServer) GetInfo(ctx context.Context, req *Empty) (*CommandStationInfo, error) {
   164  	return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented")
   165  }
   166  func (*UnimplementedCommandStationServiceServer) Power(srv CommandStationService_PowerServer) error {
   167  	return status.Errorf(codes.Unimplemented, "method Power not implemented")
   168  }
   169  func (*UnimplementedCommandStationServiceServer) Locs(srv CommandStationService_LocsServer) error {
   170  	return status.Errorf(codes.Unimplemented, "method Locs not implemented")
   171  }
   172  
   173  func RegisterCommandStationServiceServer(s *grpc.Server, srv CommandStationServiceServer) {
   174  	s.RegisterService(&_CommandStationService_serviceDesc, srv)
   175  }
   176  
   177  func _CommandStationService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   178  	in := new(Empty)
   179  	if err := dec(in); err != nil {
   180  		return nil, err
   181  	}
   182  	if interceptor == nil {
   183  		return srv.(CommandStationServiceServer).GetInfo(ctx, in)
   184  	}
   185  	info := &grpc.UnaryServerInfo{
   186  		Server:     srv,
   187  		FullMethod: "/binkynet.v1.CommandStationService/GetInfo",
   188  	}
   189  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   190  		return srv.(CommandStationServiceServer).GetInfo(ctx, req.(*Empty))
   191  	}
   192  	return interceptor(ctx, in, info, handler)
   193  }
   194  
   195  func _CommandStationService_Power_Handler(srv interface{}, stream grpc.ServerStream) error {
   196  	return srv.(CommandStationServiceServer).Power(&commandStationServicePowerServer{stream})
   197  }
   198  
   199  type CommandStationService_PowerServer interface {
   200  	Send(*Power) error
   201  	Recv() (*PowerState, error)
   202  	grpc.ServerStream
   203  }
   204  
   205  type commandStationServicePowerServer struct {
   206  	grpc.ServerStream
   207  }
   208  
   209  func (x *commandStationServicePowerServer) Send(m *Power) error {
   210  	return x.ServerStream.SendMsg(m)
   211  }
   212  
   213  func (x *commandStationServicePowerServer) Recv() (*PowerState, error) {
   214  	m := new(PowerState)
   215  	if err := x.ServerStream.RecvMsg(m); err != nil {
   216  		return nil, err
   217  	}
   218  	return m, nil
   219  }
   220  
   221  func _CommandStationService_Locs_Handler(srv interface{}, stream grpc.ServerStream) error {
   222  	return srv.(CommandStationServiceServer).Locs(&commandStationServiceLocsServer{stream})
   223  }
   224  
   225  type CommandStationService_LocsServer interface {
   226  	Send(*Loc) error
   227  	Recv() (*Loc, error)
   228  	grpc.ServerStream
   229  }
   230  
   231  type commandStationServiceLocsServer struct {
   232  	grpc.ServerStream
   233  }
   234  
   235  func (x *commandStationServiceLocsServer) Send(m *Loc) error {
   236  	return x.ServerStream.SendMsg(m)
   237  }
   238  
   239  func (x *commandStationServiceLocsServer) Recv() (*Loc, error) {
   240  	m := new(Loc)
   241  	if err := x.ServerStream.RecvMsg(m); err != nil {
   242  		return nil, err
   243  	}
   244  	return m, nil
   245  }
   246  
   247  var _CommandStationService_serviceDesc = grpc.ServiceDesc{
   248  	ServiceName: "binkynet.v1.CommandStationService",
   249  	HandlerType: (*CommandStationServiceServer)(nil),
   250  	Methods: []grpc.MethodDesc{
   251  		{
   252  			MethodName: "GetInfo",
   253  			Handler:    _CommandStationService_GetInfo_Handler,
   254  		},
   255  	},
   256  	Streams: []grpc.StreamDesc{
   257  		{
   258  			StreamName:    "Power",
   259  			Handler:       _CommandStationService_Power_Handler,
   260  			ServerStreams: true,
   261  			ClientStreams: true,
   262  		},
   263  		{
   264  			StreamName:    "Locs",
   265  			Handler:       _CommandStationService_Locs_Handler,
   266  			ServerStreams: true,
   267  			ClientStreams: true,
   268  		},
   269  	},
   270  	Metadata: "commandstation.proto",
   271  }