Documentation
¶
Overview ¶
Package probegw implements the voter-side ProbeService gRPC gateway (ADR 0034, ADR 0035): probe verification, monitor assignment streaming, keepalive ticks, and validated heartbeat ingestion.
Index ¶
- type Cluster
- type Options
- type Server
- func (s *Server) Run(ctx context.Context)
- func (s *Server) SessionDetails() map[string]SessionDetail
- func (s *Server) Sessions() []*pb.ProbeSession
- func (s *Server) Subscribe(req *pb.SubscribeRequest, stream pb.ProbeService_SubscribeServer) error
- func (s *Server) UploadHeartbeats(stream pb.ProbeService_UploadHeartbeatsServer) error
- type SessionDetail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster interface {
Apply(ctx context.Context, cmd *pb.Command) (cluster.ApplyResult, error)
Members() ([]cluster.Member, uint64, error)
CommandLevel(ctx context.Context) (uint32, error)
IsLeader() bool
}
Cluster is the part of cluster.Node the probe gateway uses.
type Options ¶
type Options struct {
NodeID string
State store.State
Metrics store.Metrics
Cluster Cluster
SubscribeChanges func() (<-chan struct{}, func())
Bundle func(context.Context) ([]*x509.Certificate, string, error)
Assigner scheduler.Assigner
Keyring configsecret.Keyring
SSRFProtection bool
OnStored func([]store.Heartbeat)
Publish func([]store.Heartbeat)
OnRejected func(reason string)
Clock func() time.Time
TickInterval time.Duration
DebounceInterval time.Duration
BufferMaxAge time.Duration
PerProbeBurst int
GlobalRate float64
GlobalBurst int
Log *slog.Logger
// contains filtered or unexported fields
}
Options configure the voter-side probe gateway.
type Server ¶
type Server struct {
pb.UnimplementedProbeServiceServer
// contains filtered or unexported fields
}
Server implements pb.ProbeServiceServer on the voter's cluster port.
func (*Server) Run ¶
Run watches FSM state changes to immediately terminate sessions of revoked probes or deleted tenants (ADR 0034 section 7, ADR 0035 D8).
func (*Server) SessionDetails ¶
func (s *Server) SessionDetails() map[string]SessionDetail
SessionDetails returns active probe sessions including buffer status for the API.
func (*Server) Sessions ¶
func (s *Server) Sessions() []*pb.ProbeSession
Sessions returns the active probe sessions connected to this voter for GetStatus.
func (*Server) Subscribe ¶
func (s *Server) Subscribe(req *pb.SubscribeRequest, stream pb.ProbeService_SubscribeServer) error
Subscribe streams the monitors assigned to the calling probe, starting with a full snapshot followed by debounced deltas and periodic keepalive ticks.
func (*Server) UploadHeartbeats ¶
func (s *Server) UploadHeartbeats(stream pb.ProbeService_UploadHeartbeatsServer) error
UploadHeartbeats receives buffered and live heartbeats from a probe, validates caller identity and tenant boundaries on every entry, persists valid heartbeats, and responds with the contiguous StreamPosition.
type SessionDetail ¶
type SessionDetail struct {
NodeID string
ConnectedSinceMs int64
LastMessageMs int64
Buffer *pb.ProbeBufferStatus
}
SessionDetail describes an active probe session connected to this voter.