Documentation
¶
Overview ¶
Package tunnel implements the node side of flock.tunnel.v1.TunnelService: the persistent, node-initiated session over which the coordinator pushes dispatches, challenges and model assignments (SPEC §3: nodes dial out, never listen).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrBadSignature = errors.New("tunnel: dispatch signature verification failed")
ErrBadSignature means a DispatchRequest failed verification against the pinned coordinator key. Such dispatches are never executed (SPEC §6).
Functions ¶
func SignDispatch ¶
func SignDispatch(priv ed25519.PrivateKey, d *tunnelv1.DispatchRequest) error
SignDispatch sets d.Signature (coordinator side; used by fakecoord and control-plane tests).
func VerifyDispatch ¶
func VerifyDispatch(pub ed25519.PublicKey, d *tunnelv1.DispatchRequest) error
VerifyDispatch checks d.Signature against the pinned coordinator key.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client maintains the session and handles pushed work.
type Dialer ¶
Dialer abstracts the transport so it can swap without touching the session logic. Production transport is QUIC via quic-go (SPEC §6); gRPC-over-HTTP/2 with mTLS is the current implementation and remains the documented fallback. TODO(quic): add a quic-go Dialer implementing this interface once the coordinator terminates QUIC.
type Engine ¶
type Engine interface {
Complete(ctx context.Context, req rt.CompletionRequest) (rt.TokenStream, error)
}
Engine runs inference for dispatches and challenges. Satisfied by the daemon's engine wrapper around runtime.Instance.
type InsecureDialer ¶
type InsecureDialer struct{}
InsecureDialer is for local development only.
func (InsecureDialer) Dial ¶
func (InsecureDialer) Dial(_ context.Context, addr string) (*grpc.ClientConn, error)
type Options ¶
type Options struct {
Dialer Dialer
Addr string
NodeID string
// CoordinatorPubKey is the Ed25519 dispatch-signing key pinned at
// enrollment. Required: dispatches with bad signatures are dropped.
CoordinatorPubKey ed25519.PublicKey
Engine Engine
Admit Admitter
// Heartbeat returns a fresh heartbeat message (telemetry assembly).
Heartbeat func() *tunnelv1.Heartbeat
// Hello returns the session-open message (capability, models, budget).
Hello func() *tunnelv1.Hello
// OnModelAssignment is invoked for coordinator model placement pushes.
OnModelAssignment func(ctx context.Context, ma *tunnelv1.ModelAssignment)
HeartbeatInterval time.Duration
ReconnectMin time.Duration
ReconnectMax time.Duration
Log *slog.Logger
}
Options configures the Client.