Documentation
¶
Overview ¶
Package streamsession retains bounded transaction evidence across transports. The authenticated owner serializes calls and polls Tick during idle input. No method performs authentication, schedules timers or retains image pixels.
Index ¶
- Variables
- type Binding
- type Epoch
- type Lease
- type Result
- type Session
- func (s *Session) Abort(binding Binding) error
- func (s *Session) Acquire(expected Epoch, claim [16]byte) (Lease, error)
- func (s *Session) Begin(binding Binding, tx Transaction, now time.Duration) error
- func (s *Session) Bind(lease Lease) (Binding, error)
- func (s *Session) Commit(binding Binding, tx Transaction, now time.Duration) error
- func (s *Session) Cooldown() time.Duration
- func (s *Session) Disconnect(binding Binding) error
- func (s *Session) Epoch() Epoch
- func (s *Session) Fence() error
- func (s *Session) Query(binding Binding, tx Transaction) (Result, error)
- func (s *Session) Tick(now time.Duration) error
- func (s *Session) Write(binding Binding, tx Transaction, pass uint8, offset uint32, pixels []byte, ...) error
- type Transaction
Constants ¶
This section is empty.
Variables ¶
var ( ErrLease = errors.New("screen: stale boot, lease or binding") ErrBusy = errors.New("screen: writer or transaction active") ErrStale = errors.New("screen: transaction consumed or evidence evicted") ErrConflict = errors.New("screen: transaction digest conflict") ErrCooldown = errors.New("screen: full refresh cooldown") )
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func New ¶
func New(boot [16]byte, config streamrx.Config, sink streamrx.Sink, minimum time.Duration) (*Session, error)
New conservatively starts with a full cooldown: reboot cannot prove when the preceding firmware last refreshed. Boot must come from the board's RNG.
func (*Session) Abort ¶
Abort is also used for authenticated framing failures and USB preemption. It never releases the binding: only its owner may disconnect it.
func (*Session) Acquire ¶
Acquire uses compare-and-swap. The caller generates a fresh random 128-bit claim for each logical acquisition and retains that same claim for retries. An exact lost-ACK retry has no side effects, including when a writer is bound.
func (*Session) Bind ¶
Bind resumes a remembered lease, not one guessed from Hello. Each connection gets a non-reusable serial so a late disconnect cannot close its replacement.
func (*Session) Cooldown ¶
Cooldown reports the remaining floor without mutating the monotonic clock.
func (*Session) Disconnect ¶
Disconnect must use the binding of the connection that actually closed. Completed evidence survives; partial staging closes without a refresh.
func (*Session) Fence ¶
Fence revokes completion/ownership for credential changes without resetting physical cadence. The owner must first disconnect/abort its live binding. The new generation is unclaimed; only a fresh Acquire may establish a writer.
func (*Session) Query ¶
func (s *Session) Query(binding Binding, tx Transaction) (Result, error)
Query distinguishes an unseen future ID from consumed IDs whose evidence has been evicted. A failed/aborted ID can never restart a controller RAM pointer.