Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶
type Env interface {
// Get gets the environment variable of the given name.
Get(name string) string
}
Env is an interface to a set of environment variables.
type FS ¶
type FS interface {
// ReadAll gets the contents of filename, or an error if the file didn't exist or there was an
// error reading it.
ReadFile(filename string) ([]byte, error)
// RemoveAll removes all of the files under the directory at name. It behaves similarly to the
// func of the same name in the os package (https://godoc.org/os#RemoveAll).
RemoveAll(name string) error
}
FS is the interface to a file system.
type FakeEnv ¶
type FakeEnv struct {
// Envs is the map from which Get calls will look to retrieve environment variables.
Envs map[string]string
}
FakeEnv is an Env implementation that stores the environment in a map.
type FakeFS ¶
FakeFS is an in-memory FS implementation.
func (*FakeFS) ReadFile ¶
ReadFile is the FS interface implementation. It returns FakeFileNotFound if the file was not found in the in-memory 'filesystem' of f.
type FakeFileNotFound ¶
type FakeFileNotFound struct {
Filename string
}
FakeFileNotFound is the error returned by FakeFS when a requested file isn't found.
func (FakeFileNotFound) Error ¶
func (f FakeFileNotFound) Error() string
Error is the error interface implementation.
Source Files
¶
- env.go
- fs.go
Click to show internal directories.
Click to hide internal directories.