controlsession

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package controlsession defines the nonsecret, immutable identity persisted with a run. Possession tokens and transport admission belong elsewhere.

Index

Constants

View Source
const (
	MinLeaseDuration = time.Second
	MaxLeaseDuration = 5 * time.Minute
)
View Source
const ProtocolVersion uint32 = 3

ProtocolVersion requires both channel binding and control lease enforcement. It is independent of the guest WASI ABI and the public HTTP API version.

Variables

This section is empty.

Functions

func NewIncarnation

func NewIncarnation() (string, error)

Types

type Binding

type Binding struct {
	Incarnation string
	SessionID   string
}

Binding identifies one session in one dispatcher incarnation. Both fields must be canonical lowercase, nonzero UUID strings. The value has no token.

func NewBinding

func NewBinding(incarnation string) (Binding, error)

func ParseBinding

func ParseBinding(incarnation, sessionID string) (Binding, error)

func (Binding) Valid

func (b Binding) Valid() bool

type EndError

type EndError struct {
	Kind EndKind
	Err  error
}

EndError contains only a previously sanitized cause. Transport code must remove reflected credentials before retaining a peer error here.

func (*EndError) Error

func (e *EndError) Error() string

func (*EndError) Unwrap

func (e *EndError) Unwrap() error

type EndKind

type EndKind uint8

EndKind selects session retry policy independently of peer error text.

const (
	TransportUnavailable EndKind = iota + 1
	LeaseExpired
	ParentStopped
	IncompatibleProfile
	LocalFailure
)

func (EndKind) String

func (k EndKind) String() string

type LeaseTiming

type LeaseTiming struct {
	Duration         time.Duration
	RenewInterval    time.Duration
	RequestTimeout   time.Duration
	WatchdogInterval time.Duration
}

LeaseTiming is a validated value copied into one control session. These durations bound local admission and stop signals, not remote quiescence.

func LeaseTimingFromMillis

func LeaseTimingFromMillis(milliseconds int64) (LeaseTiming, error)

LeaseTimingFromMillis validates before multiplication, including signed wire values which would otherwise overflow time.Duration.

func NewLeaseTiming

func NewLeaseTiming(duration time.Duration) (LeaseTiming, error)

Jump to

Keyboard shortcuts

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