probegw

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: AGPL-3.0 Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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 New

func New(opts Options) *Server

New creates a ProbeService server.

func (*Server) Run

func (s *Server) Run(ctx context.Context)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL