Files
rtnetmon/internal/starlink/pb/starlink_grpc.pb.go
T
clawbot 769511dec2
check / check (push) Failing after 4s
Add Starlink status lines for the physical gateway pane (closes #3) (#7)
Detection is a TCP connect to the dish endpoint bound to the physical
interface; once a dish answers, get_status is read every 5s and two
status lines render under the physical pane, red on disconnect or
alert. No dish: nothing drawn, no RPC. Minimal vendored proto bindings
for get_status only. Independent review passed (PR 7 comment 100012).

Model: opus-4-8 (implementation and review); model: claude-fable-5
(merge)
2026-09-22 20:56:01 +02:00

141 lines
5.0 KiB
Go

// A minimal slice of the Starlink dish's local gRPC API: just the one
// unary RPC (SpaceX.API.Device.Device/Handle) and the get_status request
// and dish status response, reduced to the handful of fields rtnetmon
// shows. The proto package name and field numbers must match the dish
// exactly for the wire format to line up; every other field the dish sends
// is ignored as an unknown field.
//
// Field numbers, message names and the DishState enum are transcribed from
// the community-maintained pre-generated bindings at
// github.com/starlink-community/starlink-grpc-go, commit
// 2e89f3d7e3092adecbcc04e9e003e61ed5f7c6a3 (get_status = 1004,
// dish_get_status = 2004). They are not verified against a live dish here.
//
// Regenerate with:
// protoc --go_out=. --go_opt=paths=source_relative \
// --go-grpc_out=. --go-grpc_opt=paths=source_relative \
// internal/starlink/pb/starlink.proto
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v7.36.2
// source: internal/starlink/pb/starlink.proto
package starlinkpb
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 (
Device_Handle_FullMethodName = "/SpaceX.API.Device.Device/Handle"
)
// DeviceClient is the client API for Device 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 DeviceClient interface {
Handle(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}
type deviceClient struct {
cc grpc.ClientConnInterface
}
func NewDeviceClient(cc grpc.ClientConnInterface) DeviceClient {
return &deviceClient{cc}
}
func (c *deviceClient) Handle(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
err := c.cc.Invoke(ctx, Device_Handle_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// DeviceServer is the server API for Device service.
// All implementations must embed UnimplementedDeviceServer
// for forward compatibility.
type DeviceServer interface {
Handle(context.Context, *Request) (*Response, error)
mustEmbedUnimplementedDeviceServer()
}
// UnimplementedDeviceServer 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 UnimplementedDeviceServer struct{}
func (UnimplementedDeviceServer) Handle(context.Context, *Request) (*Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented")
}
func (UnimplementedDeviceServer) mustEmbedUnimplementedDeviceServer() {}
func (UnimplementedDeviceServer) testEmbeddedByValue() {}
// UnsafeDeviceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DeviceServer will
// result in compilation errors.
type UnsafeDeviceServer interface {
mustEmbedUnimplementedDeviceServer()
}
func RegisterDeviceServer(s grpc.ServiceRegistrar, srv DeviceServer) {
// If the following call pancis, it indicates UnimplementedDeviceServer 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(&Device_ServiceDesc, srv)
}
func _Device_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceServer).Handle(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Device_Handle_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceServer).Handle(ctx, req.(*Request))
}
return interceptor(ctx, in, info, handler)
}
// Device_ServiceDesc is the grpc.ServiceDesc for Device service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Device_ServiceDesc = grpc.ServiceDesc{
ServiceName: "SpaceX.API.Device.Device",
HandlerType: (*DeviceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Handle",
Handler: _Device_Handle_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "internal/starlink/pb/starlink.proto",
}