# Functions
And returns a predicate that evaluates to true if all of the operands evaluate to true.
Any returns an injector that injects an error if any of the provided injectors inject an error.
NewParser constructs a new parser for an encoding of a lisp-like DSL describing error injectors.
OnIndex is a convenience function for constructing a dsl.OnIndex for use with an error-injecting filesystem.
ParseDSL parses the provided string using the default DSL parser.
PathMatch returns a predicate that returns true if an operation's file path matches the provided pattern according to filepath.Match.
RandomLatency constructs an Injector that does not inject errors but instead injects random latency into operations that match the provided predicate.
Randomly constructs a new predicate that pseudorandomly evaluates to true with probability p using randomness determinstically derived from seed.
Wrap wraps an existing vfs.FS implementation, returning a new vfs.FS implementation that shadows operations to the provided FS.
WrapFile wraps an existing vfs.File, returning a new vfs.File that shadows operations to the provided vfs.File.
# Constants
OpCreate describes a create file operation.
OpFileClose describes a close file operation.
OpFileFlush describes a file flush operation.
OpFilePreallocate describes a file preallocate operation.
OpFileRead describes a file read operation.
OpFileReadAt describes a file seek read operation.
OpFileStat describes a file stat operation.
OpFileSync describes a file sync operation.
OpFileSyncData describes a file sync operation.
OpFileSyncTo describes a file sync operation.
OpFileWrite describes a file write operation.
OpFileWriteAt describes a file seek write operation.
OpGetDiskUsage describes a disk usage operation.
OpIsRead describes read operations.
OpIsWrite describes write operations.
OpLink describes a hardlink operation.
OpList describes a list directory operation.
OpLock describes a lock file operation.
OpMkdirAll describes a make directory including parents operation.
OpOpen describes a file open operation.
OpOpenDir describes a directory open operation.
OpRemove describes a remove file operation.
OpRemoveAll describes a recursive remove operation.
OpRename describes a rename operation.
OpReuseForWrite describes a reuse for write operation.
OpStat describes a path-based stat operation.
# Variables
ErrInjected is an error artificially injected for testing fs error paths.
Reads is a predicate that returns true iff an operation is a read operation.
Writes is a predicate that returns true iff an operation is a write operation.
# Structs
Counter wraps an Injector, counting the number of errors injected.
FS implements vfs.FS, injecting errors into its operations.
InjectIndex implements Injector, injecting an error at a specific index.
LabelledError is an error that also implements Injector, unconditionally injecting itself.
Op describes a filesystem operation.
A Parser parses the error-injecting DSL.
Toggle wraps an Injector.
# Interfaces
Injector injects errors into FS operations.
# Type aliases
InjectorFunc implements the Injector interface for a function with MaybeError's signature.
OpKind is an enum describing the type of operation.
OpReadWrite is an enum describing whether an operation is a read or write operation.