timeout

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(a, b Options) bool

Equal compares timeout options after normalizing time precision.

func NormalizeTime

func NormalizeTime(t time.Time) time.Time

NormalizeTime converts timeout values to the precision Kubernetes persists and E2B exposes: wall-clock time at whole-second precision in UTC. This removes Go's monotonic clock reading, drops sub-second differences, and normalizes the Location so timeout comparison and retry conflict handling stay stable across in-memory values, metav1.Time serialization, and API server round trips.

func ShouldExtendTimeout

func ShouldExtendTimeout(current, requested Options) bool

ShouldExtendTimeout reports whether requested extends the effective end time.

Types

type Options

type Options struct {
	ShutdownTime time.Time
	PauseTime    time.Time
	// Baseline is the timeout state the caller observed before issuing this update.
	// Consulted only when the policy passed to SaveTimeoutWithPolicy is BaselineAware.
	Baseline *Options `json:"-"`
}

Options is the time when Sandbox will be shut down or paused. Zero means never.

func GetTimeoutFromSandbox

func GetTimeoutFromSandbox(sbx *agentsv1alpha1.Sandbox) Options

type UpdatePolicy

type UpdatePolicy string
const (
	UpdatePolicyAlways        UpdatePolicy = "Always"
	UpdatePolicyExtendOnly    UpdatePolicy = "ExtendOnly"
	UpdatePolicyBaselineAware UpdatePolicy = "BaselineAware"
)

Jump to

Keyboard shortcuts

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