Documentation ¶
Overview ¶
Package loadertest holds a fake for the Loader interface.
Index ¶
- type FakeLoader
- func (f FakeLoader) AddDirectory(fullDirPath string) error
- func (f FakeLoader) AddFile(fullFilePath string, content []byte) error
- func (f FakeLoader) Cleanup() error
- func (f FakeLoader) Load(location string) ([]byte, error)
- func (f FakeLoader) New(newRoot string) (ifc.Loader, error)
- func (f FakeLoader) Root() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeLoader ¶
type FakeLoader struct {
// contains filtered or unexported fields
}
FakeLoader encapsulates the delegate Loader and the fake file system.
func NewFakeLoader ¶
func NewFakeLoader(initialDir string) FakeLoader
NewFakeLoader returns a Loader that uses a fake filesystem. The loader will be restricted to root only. The initialDir argument should be an absolute file path.
func NewFakeLoaderWithRestrictor ¶
func NewFakeLoaderWithRestrictor( lr loader.LoadRestrictorFunc, initialDir string) FakeLoader
NewFakeLoaderWithRestrictor returns a Loader that uses a fake filesystem. The initialDir argument should be an absolute file path.
func (FakeLoader) AddDirectory ¶
func (f FakeLoader) AddDirectory(fullDirPath string) error
AddDirectory adds a fake directory to the file system.
func (FakeLoader) AddFile ¶
func (f FakeLoader) AddFile(fullFilePath string, content []byte) error
AddFile adds a fake file to the file system.
Click to show internal directories.
Click to hide internal directories.