Documentation
¶
Index ¶
- Variables
- type Dir
- func (x Dir) AssertEmpty() Dir
- func (x Dir) AssertExists() Dir
- func (x Dir) AssertNotEmpty() Dir
- func (x Dir) AssertNotExists() Dir
- func (x Dir) AssertReadable() Dir
- func (x Dir) AssertWritable() Dir
- func (x Dir) Clear() error
- func (x Dir) Create(perm os.FileMode) error
- func (x Dir) DirAt(relativePath string) (Dir, error)
- func (x Dir) Ensure(perm os.FileMode) error
- func (x Dir) EnsureEmpty(perm os.FileMode) error
- func (x Dir) Equals(otherDir Dir) bool
- func (x Dir) Exists() bool
- func (x Dir) FileAt(relativePath string) (File, error)
- func (x Dir) Files() ([]File, error)
- func (x Dir) IsEmpty() bool
- func (x Dir) IsReadable() bool
- func (x Dir) IsWritable() bool
- func (x Dir) MustClear() Dir
- func (x Dir) MustDirAt(relativePath string) Dir
- func (x Dir) MustEnsure(perm os.FileMode) Dir
- func (x Dir) MustFileAt(relativePath string) File
- func (x Dir) Name() string
- func (x Dir) NotExists() bool
- func (x Dir) OpenStandard() error
- func (x Dir) Parent() Dir
- func (x Dir) Path() string
- func (x Dir) ReadDir() ([]os.FileInfo, error)
- func (x Dir) RelativeTo(dir Dir) string
- func (x Dir) Remove() error
- func (x Dir) String() string
- func (x Dir) WithTrailingPathSeparator() string
- func (x Dir) WithoutTrailingPathSeparator() string
- type DirPathNotRelativeError
- type File
- func (x File) Append(newContent []byte) error
- func (x File) AppendString(newContent string) error
- func (x File) AppendStringln(newContent string) error
- func (x File) AssertEmpty() File
- func (x File) AssertExists() File
- func (x File) AssertExtension(fileExtension FileExtension) File
- func (x File) AssertMd5Hash(hash string) File
- func (x File) AssertNotEmpty() File
- func (x File) AssertNotExists() File
- func (x File) AssertReadable() File
- func (x File) AssertWritable() File
- func (x File) Clear() error
- func (x File) Content() ([]byte, error)
- func (x File) ContentString() (string, error)
- func (x File) CopyTo(target File) error
- func (x File) CopyToDir(target Dir) error
- func (x File) Dir() Dir
- func (x File) EnsureDir(perm os.FileMode) error
- func (x File) Equals(otherFile File) bool
- func (x File) Exists() bool
- func (x File) Extension() *FileExtension
- func (x File) Filename() string
- func (x File) FilenameWithoutExtension() string
- func (x File) Filesize() int64
- func (x File) FilesizeHuman() string
- func (x File) HasAnyExtension() bool
- func (x File) HasExtension(fileExtension FileExtension) bool
- func (x File) InDir(dir Dir) File
- func (x File) IsEmpty() bool
- func (x File) IsHidden() bool
- func (x File) IsReadable() bool
- func (x File) IsWritable() bool
- func (x File) Md5Hash() (string, error)
- func (x File) MustClear() File
- func (x File) MustContent() []byte
- func (x File) MustContentString() string
- func (x File) MustEnsureDir(perm os.FileMode) File
- func (x File) MustMd5Hash() string
- func (x File) MustRemove() File
- func (x File) MustRenderer() *Renderer
- func (x File) NotExists() bool
- func (x File) OpenStandard() error
- func (x File) ParentDir() Dir
- func (x File) Path() string
- func (x File) RelativeTo(to Dir) string
- func (x File) Remove() error
- func (x File) Renderer() (*Renderer, error)
- func (x File) SetContent(newContent []byte) error
- func (x File) SetContentString(newContent string) error
- func (x File) SetCreatePermissions(perm os.FileMode) File
- func (x File) String() string
- func (x File) WithExtension(fileExtension FileExtension) File
- func (x File) WithFileReadOnly(logic func(f afero.File) error) error
- func (x File) WithFilename(filename string) File
- func (x File) WithoutExtension() File
- func (x File) Writer() (io.WriteCloser, error)
- type FileExtension
- type FilePathNotRelativeError
- type Renderer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ExtPdf = FileExtensionFrom("pdf") ExtJpg = FileExtensionFrom("jpg") ExtPng = FileExtensionFrom("png") ExtLog = FileExtensionFrom("log") ExtZip = FileExtensionFrom("zip") )
Functions ¶
This section is empty.
Types ¶
type Dir ¶
type Dir struct {
// contains filtered or unexported fields
}
Dir is a filesystem directory.
func WorkingDir ¶
func WorkingDir() Dir
func (Dir) AssertEmpty ¶
func (Dir) AssertExists ¶
func (Dir) AssertNotEmpty ¶
func (Dir) AssertNotExists ¶
func (Dir) AssertReadable ¶
func (Dir) AssertWritable ¶
func (Dir) IsReadable ¶
func (Dir) IsWritable ¶
func (Dir) MustFileAt ¶
func (Dir) OpenStandard ¶
func (Dir) RelativeTo ¶
func (Dir) WithTrailingPathSeparator ¶
func (Dir) WithoutTrailingPathSeparator ¶
type DirPathNotRelativeError ¶
type DirPathNotRelativeError struct {
// contains filtered or unexported fields
}
func NewDirPathNotRelativeError ¶
func NewDirPathNotRelativeError(path string) *DirPathNotRelativeError
func (DirPathNotRelativeError) Error ¶
func (x DirPathNotRelativeError) Error() string
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is a file in the filesystem.
func (File) AppendString ¶
func (File) AppendStringln ¶
func (File) AssertEmpty ¶
func (File) AssertExists ¶
func (File) AssertExtension ¶
func (x File) AssertExtension(fileExtension FileExtension) File
func (File) AssertMd5Hash ¶
func (File) AssertNotEmpty ¶
func (File) AssertNotExists ¶
func (File) AssertReadable ¶
func (File) AssertWritable ¶
func (File) ContentString ¶
func (File) Extension ¶
func (x File) Extension() *FileExtension
func (File) FilenameWithoutExtension ¶
func (File) FilesizeHuman ¶
func (File) HasAnyExtension ¶
func (File) HasExtension ¶
func (x File) HasExtension(fileExtension FileExtension) bool
func (File) IsReadable ¶
func (File) IsWritable ¶
func (File) MustContent ¶
func (File) MustContentString ¶
func (File) MustMd5Hash ¶
func (File) MustRemove ¶
func (File) MustRenderer ¶
func (File) OpenStandard ¶
func (File) RelativeTo ¶
func (File) SetContent ¶
func (File) SetContentString ¶
func (File) SetCreatePermissions ¶
SetCreatePermissions allows you to define the FileMode used when creating this file (if it did not exist).
func (File) WithExtension ¶
func (x File) WithExtension(fileExtension FileExtension) File
func (File) WithFilename ¶
func (File) WithoutExtension ¶
type FileExtension ¶
type FileExtension struct {
// contains filtered or unexported fields
}
func FileExtensionFrom ¶
func FileExtensionFrom(extension string) FileExtension
func (FileExtension) String ¶
func (x FileExtension) String() string
func (FileExtension) WithDot ¶
func (x FileExtension) WithDot() string
func (FileExtension) WithoutDot ¶
func (x FileExtension) WithoutDot() string
type FilePathNotRelativeError ¶
type FilePathNotRelativeError struct {
// contains filtered or unexported fields
}
func NewFilePathNotRelativeError ¶
func NewFilePathNotRelativeError(path string) *FilePathNotRelativeError
func (FilePathNotRelativeError) Error ¶
func (x FilePathNotRelativeError) Error() string
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
func NewRenderer ¶
func NewRendererFromFile ¶
func (*Renderer) RenderToFile ¶
Click to show internal directories.
Click to hide internal directories.