delay

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package delay shares delay evaluation and mock-file representation across protocols and faults.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(v config.Value) (vlatte.Delay, error)

Decode reads a duration shorthand or a typed distribution. Invalid parameters are config problems, never panics.

func Doc

func Doc(d vlatte.Delay) any

Doc describes d without evaluating it. Fixed delays use the scalar shorthand; all others keep their descriptor, including its error. Call only for a non-nil delay.

func Next

func Next(ctx context.Context, d vlatte.Delay) (time.Duration, error)

Next evaluates d without waiting and rejects negative outputs, including those of custom implementations. Nil and successful zero samples need no wait and succeed even when ctx has ended. Positive samples honor cancellation.

func Wait

func Wait(ctx context.Context, d vlatte.Delay) error

Wait evaluates d once and waits for a positive duration, unless the evaluation fails or ctx ends. Nil or a successful zero duration returns immediately, even when ctx has ended.

Types

This section is empty.

Jump to

Keyboard shortcuts

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