faultbuild

package
v1.3.1 Latest Latest
Warning

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

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

Documentation

Overview

Package faultbuild builds the faults of package github.com/caffeine-projects/vlatte/fault from the fault specs of mock files: an object whose type names the fault and whose other keys are its parameters, such as {"type": "latency", "delay": {"type": "jitter", "latency": "300ms", "jitter": "60ms"}}. Each fault describes itself as the spec that builds it again.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(doc any) (vlatte.Pipe, error)

Build builds the fault a spec of a mock file describes: an object whose type names the fault, and whose other keys are its parameters. Durations are whole milliseconds, or a Go duration such as "1.5s", from 0. The types, after the functions of package fault, and their parameters:

empty_response
malformed_response_chunk
random_data_then_close
connection_reset_by_peer
chunked_dribble_delay           chunks, total
latency                         delay (duration or typed delay distribution)
bandwidth                       rate: bytes per second, or gprs, dial_up, 2g, good_2g, 3g, good_3g, dsl, 4g,
                                wifi or fiber, the Bandwidth constants of package fault
slicer                          average_size, size_variation (0 by default), delay (0 by default)
slow_close                      delay
timeout                         after (0 by default)
limit_data                      bytes
connection_reset_by_peer_after  after

A spec with problems, such as a missing parameter, a key the fault doesn't take, or a value its function of package fault would panic on, fails with an error that lists each, keyed as in fault.delay.

func BuildAt

func BuildAt(doc any, origin, key string) (vlatte.Pipe, error)

BuildAt is like Build, for the spec at key of a document from origin, such as pipes[0] of "file mocks/users.yaml": its problems name both.

Types

This section is empty.

Jump to

Keyboard shortcuts

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