Versions in this module Expand all Collapse all v0 v0.4.0 Nov 7, 2026 Changes in this version + const CallerThumbprintPattern + const DefaultBaseRate + const DefaultCheckpointEvery + const DefaultCreateDeadline + const DefaultPSIPark + const DefaultPSIShed + const DefaultRefW + const DefaultResumeDeadline + const DefaultRevokeTTL + const EventCheckpoint + const EventGap + const MaxPayload + const TemplateDigestPattern + const TenantPattern + const UIDPattern + var ErrAnonymousPark = errors.New("fiberd: a fiber without a session cannot be resumed, release it instead") + var ErrAudit = errors.New("audit: record not durable") + var ErrAuditChain = errors.New("audit: spool does not verify") + var ErrCallerMismatch = errors.New("fiberd: grant is bound to another caller's key") + var ErrDeadline = errors.New("fiberd: clone missed deadline") + var ErrDeltaQuota = errors.New("fiberd: grant's parked deltas would exceed its quota on this home") + var ErrDeltaTooLarge = errors.New("fiberd: parked state exceeds w_budget_bytes; not moving it") + var ErrDeviceMismatch = errors.New(...) + var ErrDraining = errors.New("fiberd: home is draining before it stops") + var ErrFiberUnknown = errors.New("ledger: fiber unknown in this epoch") + var ErrGrantChanged = errors.New("ledger: a grant uid may change only its lease and its caller") + var ErrGrantExpired = errors.New("ledger: grant lease expired") + var ErrGrantFull = errors.New("ledger: grant at fibers.max, no capacity for a new fiber") + var ErrGrantRevoked = errors.New("ledger: grant revoked on this home") + var ErrGrantUnknown = errors.New("ledger: grant not held by this home") + var ErrHandoffUnbound = errors.New("fiberd: handoff grant is not bound to a caller key") + var ErrIncompatible = errors.New("fiberd: parked state was made on an incompatible platform; not moving it") + var ErrNeedsDevice = errors.New("fiberd: grant needs a device class this home does not offer") + var ErrNeedsHandoff = errors.New("fiberd: handoff grant needs a home that hands connections to fibers") + var ErrNeedsIsolation = errors.New("fiberd: untrusted grant needs a runtime that isolates tenants") + var ErrNeedsTier = errors.New("ledger: runtime tier below what the grant or session requires") + var ErrNeedsWorkspace = errors.New(...) + var ErrNoPool = errors.New("pool: the grant's template cannot pool") + var ErrNoTenant = errors.New("fiberd: named session needs a grant with a tenant") + var ErrNoWorkspace = errors.New("fiberd: the fiber's grant has no workspace (disk_budget_bytes is zero)") + var ErrNotReady = errors.New("fiberd: template not ready on this home") + var ErrPayloadTooLarge = errors.New("fiberd: payload exceeds 4096 bytes") + var ErrPressure = errors.New("pressure: grant is shedding new clones") + var ErrRateLimit = errors.New("rate limit: clone rate over f(W), retry later") + var ErrSessionRunning = errors.New("fiberd: the session is running, release its fiber with discard instead") + var ErrSessionUnknown = errors.New("fiberd: no parked session by that name") + var ErrUnboundGrant = errors.New("fiberd: grant is not bound to a caller key") + var ErrVerifyUnavailable = errors.New("fiberd: cannot verify offline; key material unavailable") + var ErrWrongAudience = errors.New("fiberd: grant audience is not this home") + var ErrYielded = errors.New("pool: the fill yielded to a clone") + func DeviceFits(asked, class string, capacity uint64) error + func GrantDeadlines(rt Runtime, grantUID string) (create, resume time.Duration) + type Action int + const ActAttach + const ActCreate + const ActResume + func (a Action) String() string + type AuditRecord struct + Detail string + Event string + Fence Fence + FiberID string + Hash string + Lost *SeqRange + PrevHash string + Scope map[string]string + Seq uint64 + Session string + Signature string + Signer string + Time time.Time + type Auditor interface + Append func(ctx context.Context, d Durability, rec AuditRecord) error + type Checkpoints struct + Every int + Key ed25519.PrivateKey + KeyID string + type CloneRequest struct + CallerCert []byte + CallerThumbprint string + Deadline time.Duration + GrantJWT []byte + Payload []byte + Session string + type CloneResponse struct + Endpoint string + Fence Fence + FiberID string + Kind Action + RoutingKey string + ServerCert []byte + ServerKeySHA256 string + type CloneSource int + const SourceDelta + const SourceZygote + type CloneSpec struct + CallerCert []byte + Deadline time.Duration + Fence Fence + Grant Grant + Payload []byte + Ref string + Session string + Source CloneSource + type Core struct + Audit Auditor + Devices func(ctx context.Context, g Grant) (DeviceChannel, func(), error) + Epoch *EpochStore + Health *SourceHealth + Ledger *Ledger + MobilityBudget func(g Grant) uint64 + NodeID string + OwnGrant func() ([]byte, bool) + Pressure *PressureController + RateLimit *RateLimit + RequireBoundGrants bool + Revoked *Revoked + Runtime Runtime + Scope func() []ScopeClaim + SelfAdmitUID string + StatusInterval time.Duration + Store *SnapshotStore + Verify Verifier + func (a *Core) Admit(ctx context.Context, g Grant) (StatusCode, error) + func (a *Core) BumpEpoch(ctx context.Context, reason string) (uint64, error) + func (a *Core) Clone(ctx context.Context, req CloneRequest) (CloneResponse, StatusCode, error) + func (a *Core) Discard(ctx context.Context, req DiscardRequest) (StatusCode, error) + func (a *Core) Drain(ctx context.Context) DrainReport + func (a *Core) DrainPool(grantUID string, n int) int + func (a *Core) Draining() bool + func (a *Core) OnExit(ctx context.Context, ex FiberExit) + func (a *Core) Park(ctx context.Context, fiberID string, sync bool) (string, StatusCode, error) + func (a *Core) Reconcile(ctx context.Context, snap Snapshot) (ReconcileReport, error) + func (a *Core) Redeliver(ctx context.Context, grantUID string) + func (a *Core) Release(ctx context.Context, fiberID string, discard bool) (StatusCode, error) + func (a *Core) Remove(ctx context.Context, grantUID string) + func (a *Core) Revoke(grantUID string) + func (a *Core) Run(ctx context.Context) + func (a *Core) Sweep(ctx context.Context) int + func (a *Core) Watch(ctx context.Context) <-chan []Status + func (a *Core) Yield(ctx context.Context, grantUID string, reason string) + type DeadlineAdvisor interface + DefaultDeadlines func(grantUID string) (create, resume time.Duration) + type DeltaChecker interface + HasDelta func(ref string) bool + type DeltaDeleter interface + DeleteDelta func(ctx context.Context, g Grant, session, handle string) (remote string, removed bool, err error) + type DeltaDiscarder interface + DiscardDelta func(ctx context.Context, deltaRef string) error + type DeltaFinder interface + ClaimDelta func(ctx context.Context, g Grant, session string, rd RemoteDelta) (deltaRef string, err error) + FindDelta func(ctx context.Context, g Grant, session string) (RemoteDelta, bool, error) + Owned func(ctx context.Context, deltaRef string) bool + type DeltaPublisher interface + PublishDelta func(ctx context.Context, deltaRef string, g Grant, session string) (remote string, err error) + type DeltaRetirer interface + RetireDelta func(ctx context.Context, deltaRef string) error + type DeltaSweeper interface + SweepDeltas func(ctx context.Context, keep []string) (removed int, err error) + type DeviceAware interface + AttachDevices func(grantUID string, fc DeviceChannel) + type DeviceBudget struct + Bytes uint64 + Class string + type DeviceCapable interface + DeviceOffer func(grantUID string) (class string, capacity uint64) + type DeviceChannel struct + Detail string + Devices []string + Kind string + type DeviceEngine struct + CC string + Capacity uint64 + Class string + Driver string + GPU string + Grant string + Layout string + Up bool + Used uint64 + Version string + type DeviceEvent struct + DeltaBytes uint64 + Fence string + Grant string + Kind string + MS float64 + Seq uint64 + Session string + SliceBytes uint64 + T string + type DeviceReport struct + Engines []DeviceEngine + Events []DeviceEvent + type DeviceReporter interface + DeviceReport func(since uint64) DeviceReport + type DiscardRequest struct + CallerThumbprint string + GrantJWT []byte + Session string + type DrainReport struct + Failed int + Left int + Parked int + Published int + Shed int + func (r DrainReport) String() string + type Durability int + const BestEffort + const DurabilityUnspecified + const Sync + type EndpointMode int + const EndpointDirect + const EndpointHandoff + func ParseEndpointMode(s string) (EndpointMode, error) + func (m EndpointMode) String() string + type EpochStore struct + func OpenEpochStore(dir string) (*EpochStore, error) + func (s *EpochStore) Bump() (uint64, error) + func (s *EpochStore) Current() uint64 + type Fence struct + Epoch uint64 + GrantUID string + Seq uint64 + func ParseFence(s string) (Fence, error) + func (f Fence) Newer(o Fence) bool + func (f Fence) String() string + type FiberExit struct + Detail string + FiberID string + Reason string + type FiberHandle struct + Endpoint string + ID string + Pooled bool + type FiberInfo struct + ID string + Session string + WUsed uint64 + type FiberStats struct + DeviceUsedBytes uint64 + WUsedBytes uint64 + type FileInfo struct + ModTime time.Time + Mode fs.FileMode + Path string + SHA256 []byte + Size int64 + type FileReader interface + Info func() FileInfo + type FileStore interface + Download func(ctx context.Context, fiberID, path string, offset int64) (FileReader, error) + ListFiles func(ctx context.Context, fiberID, dir string) ([]FileInfo, error) + Upload func(ctx context.Context, fiberID, path string, size int64, mode fs.FileMode, ...) (FileInfo, error) + type Grant struct + Audience string + CallerThumbprint string + DeviceBudget DeviceBudget + DiskBudgetBytes uint64 + FiberMax int + FiberWarm int + Issuer string + LeaseExpiry time.Time + MinTier Tier + Policy Policy + TemplateDigest string + Tenant string + Token string + UID string + WBudgetBytes uint64 + func (g Grant) Expired(now time.Time) bool + func (g Grant) SessionDomain() (string, error) + func (g Grant) Validate() error + type HandoffRouter interface + HandoffRoute func(fiberID string) (routingKey, serverKeySHA256 string, serverCert []byte, ok bool) + HandsOff func() bool + type Isolation int + const IsolationUnspecified + const Trusted + const Untrusted + func ParseIsolation(s string) (Isolation, error) + func (i Isolation) String() string + func (i Isolation) Untrusted() bool + type Isolator interface + IsolatesTenants func() bool + type Ledger struct + Now func() time.Time + func NewLedger(epoch uint64) *Ledger + func (l *Ledger) AdmitGrant(g Grant) + func (l *Ledger) BumpEpoch(epoch uint64) + func (l *Ledger) Epoch() uint64 + func (l *Ledger) Fiber(fiberID string) (Fence, bool) + func (l *Ledger) FiberSession(fiberID string) string + func (l *Ledger) FibersOf(grantUID string) []FiberInfo + func (l *Ledger) ForgetSession(grantUID, session string) + func (l *Ledger) Grant(uid string) (Grant, bool) + func (l *Ledger) GrantBoundTo(uid, thumbprint string) bool + func (l *Ledger) OnFiberExit(fiberID string) (fence Fence, session, deltaRef string, ok bool) + func (l *Ledger) OnPark(fiberID, deltaRef string) (session, superseded string) + func (l *Ledger) OnRelease(fiberID string) (session, deltaRef string) + func (l *Ledger) PoolRoom(grantUID string) int + func (l *Ledger) RestoreParked(s SessionSnapshot) bool + func (l *Ledger) RevokeGrant(uid string) + func (l *Ledger) RunningFibers() []string + func (l *Ledger) SessionState(grantUID, session string) (SessionState, string, bool) + func (l *Ledger) SetFiberW(fiberID string, bytes uint64) + func (l *Ledger) SetPooled(grantUID string, n int) bool + func (l *Ledger) Snapshot() Snapshot + func (l *Ledger) Statuses() []Status + type MaxPressure []PressureSource + func (m MaxPressure) Pressure(grantUID string) (float64, error) + type Policy struct + AuditClass string + Durability Durability + EndpointMode EndpointMode + Isolation Isolation + PSISomeAvg10Park float64 + PSISomeAvg10Shed float64 + SessionClass string + type Pooler interface + Drain func(grantUID string, n int) int + Fill func(ctx context.Context, g Grant, deadline time.Duration) error + Pooled func(grantUID string) int + PooledExits func() <-chan string + type PressureController struct + Drain func(grantUID string, n int) int + Interval time.Duration + Ledger *Ledger + Park func(ctx context.Context, fiberID string) error + Release func(ctx context.Context, fiberID string) error + Source PressureSource + Yield func(ctx context.Context, grantUID string) + func (c *PressureController) Run(ctx context.Context) + func (c *PressureController) Shedding(grantUID string) bool + func (c *PressureController) Tick(ctx context.Context) + type PressureSource interface + Pressure func(grantUID string) (someAvg10 float64, err error) + type RateLimit struct + func NewRateLimit(baseClonesPerSec, refWBytes float64) *RateLimit + func (b *RateLimit) ObserveWorkingSet(bytes float64) + func (b *RateLimit) Take() error + type ReconcileReport struct + DeltasSwept int + GrantsExpired int + GrantsReadmitted int + GrantsUnavailable int + GrantsUnverified int + OrphansKilled int + ParkedDropped int + ParkedHeld int + ParkedRestored int + type RemoteDelta struct + Handle string + Home string + WBytes uint64 + type RemoteMiss struct + Err error + PreferredHome string + func (m *RemoteMiss) Error() string + func (m *RemoteMiss) Unwrap() error + type Revoked struct + func OpenRevoked(path string, ttl time.Duration, now time.Time) (*Revoked, error) + func (r *Revoked) Add(uid string, lease, now time.Time) error + func (r *Revoked) Clear(uid string) (bool, error) + func (r *Revoked) Denied(uid string, lease, now time.Time) bool + type Runtime interface + Clone func(ctx context.Context, spec CloneSpec) (FiberHandle, error) + Exits func() <-chan FiberExit + List func(ctx context.Context) ([]FiberHandle, error) + Park func(ctx context.Context, fiberID string, sync bool) (deltaRef string, err error) + PrepareTemplate func(ctx context.Context, g Grant) error + Release func(ctx context.Context, fiberID string, discard bool) error + Stats func(ctx context.Context, fiberID string) (FiberStats, error) + Tier func() Tier + type ScopeClaim struct + Name string + Value string + type SeqRange struct + From uint64 + To uint64 + type Session struct + DeltaRef string + Fence Fence + GrantUID string + Handle FiberHandle + Name string + State SessionState + type SessionSnapshot struct + DeltaRef string + Fence Fence + FiberID string + GrantUID string + Name string + State SessionState + type SessionState int + const StateParked + const StateRunning + type Snapshot struct + Epoch uint64 + Grants []Grant + SavedAt time.Time + Sessions []SessionSnapshot + type SnapshotStore struct + Path string + func (st *SnapshotStore) Load() (Snapshot, error) + func (st *SnapshotStore) Persist(snapshot func() Snapshot) error + type SourceHealth struct + func NewSourceHealth(stale time.Duration, now time.Time) *SourceHealth + func (h *SourceHealth) Healthy(now time.Time) bool + func (h *SourceHealth) MarkSync(now time.Time) + type Spool struct + func OpenSpool(dir string, cp *Checkpoints) (*Spool, error) + func (s *Spool) Append(_ context.Context, d Durability, rec AuditRecord) error + func (s *Spool) Close() error + func (s *Spool) Poisoned() error + type SpoolReport struct + Checkpoints int + Gaps []AuditRecord + Records int + SignedSeq uint64 + TornTail bool + Unchained int + Unsigned int + func VerifySpool(path string, trust map[string]ed25519.PublicKey) (SpoolReport, error) + type Status struct + GrantUID string + Latest Fence + Parked int + Pooled int + Running int + WUsedBytes uint64 + type StatusCode int + const DeferredFallback + const Internal + const Invalid + const NeedsTier + const NoWorkspace + const NotFound + const OK + const OverBudget + const Shed + const Unauthenticated + type TemplateDropper interface + DropTemplate func(grantUID string) + type Tier int + const TierBasic + const TierCheckpoint + const TierSnapshot + const TierUnspecified + const TierWarm + func ParseTier(s string) (Tier, error) + func (t Tier) String() string + type Verifier interface + Verify func(ctx context.Context, token []byte) (Grant, error) + type WorkspaceHolder interface + HoldsWorkspaces func() bool v0.4.0-rc.1 Nov 6, 2026