testutils

package
v0.0.0-...-819691a Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StubFS = StubFileSystem{
		FS:               mockFS,
		ContentRoot:      "web/content",
		TemplateLocation: "base_template.html",
	}
)

Functions

This section is empty.

Types

type StubFileSystem

type StubFileSystem struct {
	FS               fstest.MapFS
	ContentRoot      string
	TemplateLocation string
}

func (StubFileSystem) Create

func (s StubFileSystem) Create(name string) (io.Writer, error)

Create creates a file with the given name

func (StubFileSystem) GetContentRoot

func (s StubFileSystem) GetContentRoot() string

func (StubFileSystem) GetTemplateLocation

func (s StubFileSystem) GetTemplateLocation() string

func (StubFileSystem) MkdirAll

func (s StubFileSystem) MkdirAll(path string, perm os.FileMode) error

func (StubFileSystem) ReadDir

func (s StubFileSystem) ReadDir(name string) ([]fs.DirEntry, error)

func (StubFileSystem) ReadFile

func (s StubFileSystem) ReadFile(filename string) ([]byte, error)

func (StubFileSystem) Stat

func (s StubFileSystem) Stat(name string) (os.FileInfo, error)

func (StubFileSystem) WriteFile

func (s StubFileSystem) WriteFile(name string, data []byte, perm os.FileMode) error

Jump to

Keyboard shortcuts

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