vos

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package vos provides a basic virtual OS abstraction implementation.

This package mimicks "os" package features in-memory, so no real files are created, read, updated, or deleted. The package provides a "Patch()" function to inject this implementation e.g. during testing. Only test packages typically need to use this.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatchExit

func CatchExit(catch func(code int))

CatchExit allows recovering from vos.Exit() and calls catch with the denoted exit code.

func ClearStdio

func ClearStdio(v vos)

ClearStdio clears IO read-writers for Stdin, Stdout, and Stderr of the vos instance.

func GetStdio

func GetStdio(v vos) (stdin, stdout, stderr io.ReadWriter)

GetStdio returns IO read-writers for Stdin, Stdout, and Stderr of the vos instance.

func MkTempDir

func MkTempDir(v vos) string

MkTempDir creates a new pseudo-temporary directory.

func New

func New() vos

func Patch

func Patch() (vos, func())

func PatchArgs

func PatchArgs() (set func(args []string), reset func())

PatchArgs allows temporary overwriting of OS package args.

Types

This section is empty.

Jump to

Keyboard shortcuts

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