Documentation
¶
Index ¶
- func AppendErr(m *MultiError, err error)
- type FileChecker
- func (fc *FileChecker) Check() error
- func (fc *FileChecker) Content(content string) *FileChecker
- func (fc *FileChecker) IsDir() *FileChecker
- func (fc *FileChecker) IsFile() *FileChecker
- func (fc *FileChecker) IsSymlink() *FileChecker
- func (fc *FileChecker) ModeEquals(perm os.FileMode) *FileChecker
- func (fc *FileChecker) Owner(uid, gid int) *FileChecker
- type MultiError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendErr ¶
func AppendErr(m *MultiError, err error)
AppendErr appends err to MultiError if err is not nil.
Types ¶
type FileChecker ¶
FileChecker allows chaining multiple checks on a file path.
func NewFileChecker ¶
func NewFileChecker(path string) *FileChecker
NewFileChecker creates a FileChecker for the given path.
func (*FileChecker) Check ¶
func (fc *FileChecker) Check() error
Check runs all checks on the FileChecker's path, returning the first error encountered.
func (*FileChecker) Content ¶
func (fc *FileChecker) Content(content string) *FileChecker
Content adds a check that the file at the path has the specified content.
func (*FileChecker) IsDir ¶
func (fc *FileChecker) IsDir() *FileChecker
IsDir adds a check that the path is a directory.
func (*FileChecker) IsFile ¶
func (fc *FileChecker) IsFile() *FileChecker
IsFile adds a check that the path is a regular file.
func (*FileChecker) IsSymlink ¶
func (fc *FileChecker) IsSymlink() *FileChecker
IsSymlink adds a check that the path is a symlink.
func (*FileChecker) ModeEquals ¶
func (fc *FileChecker) ModeEquals(perm os.FileMode) *FileChecker
ModeEquals adds a check that the path has the specified permission bits.
func (*FileChecker) Owner ¶
func (fc *FileChecker) Owner(uid, gid int) *FileChecker
Owner adds a check that the path has the specified uid and gid.
type MultiError ¶
type MultiError []error
MultiError aggregates multiple errors into one.
func (MultiError) Error ¶
func (m MultiError) Error() string