vfs

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SnapshotNotFound = errors.New("snapshot not found")

Functions

func AssertContentWasStored

func AssertContentWasStored(t *testing.T, fs *MemFs, path string, expected []byte)

func AssertSnapShotContains added in v0.3.0

func AssertSnapShotContains(t *testing.T, fs *MemFs, path string, expected string)

func AssertSnapshotWasCreated

func AssertSnapshotWasCreated(t *testing.T, fs *MemFs, path string)

Types

type MemFs

type MemFs struct {
	// contains filtered or unexported fields
}

func NewMemFs

func NewMemFs() *MemFs

func (*MemFs) Exists

func (fs *MemFs) Exists(name string) (bool, error)

func (*MemFs) ReadFile

func (fs *MemFs) ReadFile(name string) ([]byte, error)

func (*MemFs) WriteFile

func (fs *MemFs) WriteFile(name string, data []byte) error

type OsFs

type OsFs struct {
}

func NewOsFs

func NewOsFs() OsFs

func (OsFs) Exists

func (o OsFs) Exists(name string) (bool, error)

func (OsFs) ReadFile

func (o OsFs) ReadFile(name string) ([]byte, error)

func (OsFs) WriteFile

func (o OsFs) WriteFile(name string, data []byte) error

type Vfs

type Vfs interface {
	Exists(name string) (bool, error)
	WriteFile(name string, data []byte) error
	ReadFile(name string) ([]byte, error)
}

Jump to

Keyboard shortcuts

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