Documentation ¶
Index ¶
- func IsNotDir(err error) bool
- func PosixSliceStringer(ps []PosixPath) (str []string)
- type Dangerously
- type FileInfoAdditions
- type FlavorCasts
- type Fs
- type Globber
- type LexOrderPosix
- type LexOrderPure
- type MustActions
- type PosixPath
- type PosixPathOps
- type PosixPathOpsT
- type Posixly
- type PurePath
- type Purely
- type RichFileInfo
- type Symlinker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PosixSliceStringer ¶
Types ¶
type Dangerously ¶
type Dangerously interface {
Must() MustActions
}
type FileInfoAdditions ¶
type FlavorCasts ¶
type FlavorCasts interface { Posixly Purely Dangerously }
type LexOrderPosix ¶
type LexOrderPosix []PosixPath
func (LexOrderPosix) Len ¶
func (o LexOrderPosix) Len() int
func (LexOrderPosix) Less ¶
func (o LexOrderPosix) Less(i, j int) bool
func (LexOrderPosix) Swap ¶
func (o LexOrderPosix) Swap(i, j int)
type LexOrderPure ¶
type LexOrderPure []PurePath
func (LexOrderPure) Len ¶
func (o LexOrderPure) Len() int
func (LexOrderPure) Less ¶
func (o LexOrderPure) Less(i, j int) bool
func (LexOrderPure) Swap ¶
func (o LexOrderPure) Swap(i, j int)
type MustActions ¶
type MustActions interface { FlavorCasts fmt.Stringer Mkdir(perm os.FileMode) MkdirAll(perm os.FileMode) Remove() RemoveAll() Touch(perm os.FileMode, existOk bool) // Match returns true if the pattern matches the last path component // of this path. Note that ths wlll only blow up if the pattern itself // is invalid Match(pattern string) bool // ExMatch performs an extended match on the entire path string using // the globbing library github.com/gobwas/glob. This function will only // blow up if the pattern is not valid ExMatch(pattern string) bool }
these provide panic-inducing versions of the PosixPath actions for when you're pretty sure it's just gonna work and want the convenience
func NewMustAction ¶
func NewMustAction(s string) MustActions
type PosixPath ¶
type PosixPath interface { FileInfoAdditions FlavorCasts fmt.Stringer Name() string Parent() PosixPath Join(names ...string) PosixPath Clean() PosixPath Match(pattern string) (matched bool, err error) ExMatch(pattern string) (matched bool, err error) Split() (dir PosixPath, file string) Stat() (RichFileInfo, error) Lstat() (RichFileInfo, error) SymlinkTo(path string) error Rel(other string) (PosixPath, error) Resolve() (PosixPath, error) Mkdir(perm os.FileMode) error MkdirAll(perm os.FileMode) error Remove() error RemoveAll() error Lexists() bool Exists() bool IsMount() bool SameFile(other PosixPath) (bool, error) IsDir() bool Glob(pattern string) ([]PosixPath, error) Touch(perm os.FileMode, existOk bool) error }
Provide path manipulation like PurePath, but also posix actions on the real filesystem. Note that the FileInfoAdditions actions on a PosixPath will ignore all errors and return false. This is the strategy that the Python stdlib 'pathlib' follows in the interest of ease of use. If you really need to know about every error type, then use Stat() and inspect the error case before interrogating the FileInfoAdditions method.
func NewPosixPath ¶
type PosixPathOps ¶
type PosixPathOpsT ¶
type PosixPathOpsT []PosixPath
type PurePath ¶
type PurePath interface { fmt.Stringer FlavorCasts Name() string Parent() PurePath Join(names ...string) PurePath Clean() PurePath Match(pattern string) (matched bool, err error) // ExMatch performs an extended match on this PurePath // see github.com/gobwas/glob for syntax. // (basically '**' is supported) ExMatch(pattern string) (matched bool, err error) Split() (dir PurePath, file string) }
func NewPurePath ¶
type RichFileInfo ¶
type RichFileInfo interface { os.FileInfo FileInfoAdditions String() string // contains filtered or unexported methods }
Click to show internal directories.
Click to hide internal directories.