Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrIllegalDir = errors.New("illegal file path reference outside of working directory")
ErrIllegalDir is returned, if the file path reference is outside of the working directory.
Functions ¶
This section is empty.
Types ¶
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
func NewDirectory ¶
NewDirectory returns a new Directory filesystem adapter for a given directory.
type FS ¶
type FS interface {
Create(string) (io.WriteCloser, error)
WriteFile(name string, data []byte, perm os.FileMode) error
}
FS is interface for operating on the files of the underlying filesystem.
type FSCloser ¶
FSCloser is an FS that can be closed.
func New ¶
New returns appropriate filesystem based on the name of the location. Logic is simple:
- if location is "/dev/null", NOP adapter is returned, unless ForceZIP option is given, in which case ZIP adapter is returned over /dev/null.
- if location has a known extension, the appropriate adapter is returned.
- else: it's a directory.
Currently supported extensions: ".zip" (case insensitive)
type ZIP ¶
type ZIP struct {
// contains filtered or unexported fields
}
ZIP is a filesystem adapter for zip files.
func NewZipFile ¶
NewZipFile returns a new ZIP filesystem adapter for a given filename.
func (*ZIP) Close ¶
Close closes the underlying zip writer and the file handle. It is only necessary if ZIP was initialised using NewZipFile
Directories
¶
| Path | Synopsis |
|---|---|
|
mocks
|
|
|
mock_fsadapter
Code generated by MockGen.
|
Code generated by MockGen. |