Documentation
¶
Overview ¶
Package pathlib is a generated GoMock package.
Index ¶
- type MockPath
- func (m *MockPath) Absolute() (Path, error)
- func (m *MockPath) Chmod(mode os.FileMode) error
- func (m *MockPath) Cwd() (Path, error)
- func (m *MockPath) EXPECT() *MockPathMockRecorder
- func (m *MockPath) Exists() bool
- func (m *MockPath) ExpandUser() Path
- func (m *MockPath) IsAbsolute() bool
- func (m *MockPath) IsDir() bool
- func (m *MockPath) IsFile() bool
- func (m *MockPath) IsRelativeTo(value Path) bool
- func (m *MockPath) JoinPath(elem ...string) Path
- func (m *MockPath) MkDir(mode os.FileMode, parents bool) error
- func (m *MockPath) Name() string
- func (m *MockPath) Open() ([]byte, error)
- func (m *MockPath) Parent() (Path, error)
- func (m *MockPath) Parts() []string
- func (m *MockPath) RmDir() error
- func (m *MockPath) Set(value string)
- func (m *MockPath) Stem() string
- func (m *MockPath) String() string
- func (m *MockPath) Suffix() string
- func (m *MockPath) Touch() error
- func (m *MockPath) Unlink() error
- func (m *MockPath) WithSuffix(value string) Path
- type MockPathMockRecorder
- func (mr *MockPathMockRecorder) Absolute() *gomock.Call
- func (mr *MockPathMockRecorder) Chmod(mode interface{}) *gomock.Call
- func (mr *MockPathMockRecorder) Cwd() *gomock.Call
- func (mr *MockPathMockRecorder) Exists() *gomock.Call
- func (mr *MockPathMockRecorder) ExpandUser() *gomock.Call
- func (mr *MockPathMockRecorder) IsAbsolute() *gomock.Call
- func (mr *MockPathMockRecorder) IsDir() *gomock.Call
- func (mr *MockPathMockRecorder) IsFile() *gomock.Call
- func (mr *MockPathMockRecorder) IsRelativeTo(value interface{}) *gomock.Call
- func (mr *MockPathMockRecorder) JoinPath(elem ...interface{}) *gomock.Call
- func (mr *MockPathMockRecorder) MkDir(mode, parents interface{}) *gomock.Call
- func (mr *MockPathMockRecorder) Name() *gomock.Call
- func (mr *MockPathMockRecorder) Open() *gomock.Call
- func (mr *MockPathMockRecorder) Parent() *gomock.Call
- func (mr *MockPathMockRecorder) Parts() *gomock.Call
- func (mr *MockPathMockRecorder) RmDir() *gomock.Call
- func (mr *MockPathMockRecorder) Set(value interface{}) *gomock.Call
- func (mr *MockPathMockRecorder) Stem() *gomock.Call
- func (mr *MockPathMockRecorder) String() *gomock.Call
- func (mr *MockPathMockRecorder) Suffix() *gomock.Call
- func (mr *MockPathMockRecorder) Touch() *gomock.Call
- func (mr *MockPathMockRecorder) Unlink() *gomock.Call
- func (mr *MockPathMockRecorder) WithSuffix(value interface{}) *gomock.Call
- type Path
- type PathImpl
- func (p PathImpl) Absolute() (Path, error)
- func (p PathImpl) Chmod(mode os.FileMode) error
- func (p PathImpl) Cwd() (Path, error)
- func (p PathImpl) Exists() bool
- func (p PathImpl) ExpandUser() Path
- func (p PathImpl) IsAbsolute() bool
- func (p PathImpl) IsDir() bool
- func (p PathImpl) IsFile() bool
- func (p PathImpl) IsLink() (bool, Path, error)
- func (p PathImpl) IsRelativeTo(value Path) bool
- func (p PathImpl) JoinPath(elem ...string) Path
- func (p PathImpl) MkDir(mode os.FileMode, parents bool) (err error)
- func (p PathImpl) Name() string
- func (p PathImpl) Open() ([]byte, error)
- func (p PathImpl) Parent() (Path, error)
- func (p PathImpl) Parts() []string
- func (p PathImpl) RmDir() error
- func (p PathImpl) Set(value string)
- func (p PathImpl) Stem() string
- func (p PathImpl) String() string
- func (p PathImpl) Suffix() string
- func (p PathImpl) Touch() error
- func (p PathImpl) Unlink() error
- func (p PathImpl) WithSuffix(value string) Path
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockPath ¶
type MockPath struct {
// contains filtered or unexported fields
}
MockPath is a mock of Path interface
func NewMockPath ¶
func NewMockPath(ctrl *gomock.Controller) *MockPath
NewMockPath creates a new mock instance
func (*MockPath) EXPECT ¶
func (m *MockPath) EXPECT() *MockPathMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockPath) IsRelativeTo ¶ added in v0.1.12
IsRelativeTo mocks base method
func (*MockPath) WithSuffix ¶ added in v0.1.9
WithSuffix mocks base method
type MockPathMockRecorder ¶
type MockPathMockRecorder struct {
// contains filtered or unexported fields
}
MockPathMockRecorder is the mock recorder for MockPath
func (*MockPathMockRecorder) Absolute ¶
func (mr *MockPathMockRecorder) Absolute() *gomock.Call
Absolute indicates an expected call of Absolute
func (*MockPathMockRecorder) Chmod ¶
func (mr *MockPathMockRecorder) Chmod(mode interface{}) *gomock.Call
Chmod indicates an expected call of Chmod
func (*MockPathMockRecorder) Cwd ¶
func (mr *MockPathMockRecorder) Cwd() *gomock.Call
Cwd indicates an expected call of Cwd
func (*MockPathMockRecorder) Exists ¶
func (mr *MockPathMockRecorder) Exists() *gomock.Call
Exists indicates an expected call of Exists
func (*MockPathMockRecorder) ExpandUser ¶
func (mr *MockPathMockRecorder) ExpandUser() *gomock.Call
ExpandUser indicates an expected call of ExpandUser
func (*MockPathMockRecorder) IsAbsolute ¶
func (mr *MockPathMockRecorder) IsAbsolute() *gomock.Call
IsAbsolute indicates an expected call of IsAbsolute
func (*MockPathMockRecorder) IsDir ¶
func (mr *MockPathMockRecorder) IsDir() *gomock.Call
IsDir indicates an expected call of IsDir
func (*MockPathMockRecorder) IsFile ¶
func (mr *MockPathMockRecorder) IsFile() *gomock.Call
IsFile indicates an expected call of IsFile
func (*MockPathMockRecorder) IsRelativeTo ¶ added in v0.1.12
func (mr *MockPathMockRecorder) IsRelativeTo(value interface{}) *gomock.Call
IsRelativeTo indicates an expected call of IsRelativeTo
func (*MockPathMockRecorder) JoinPath ¶
func (mr *MockPathMockRecorder) JoinPath(elem ...interface{}) *gomock.Call
JoinPath indicates an expected call of JoinPath
func (*MockPathMockRecorder) MkDir ¶
func (mr *MockPathMockRecorder) MkDir(mode, parents interface{}) *gomock.Call
MkDir indicates an expected call of MkDir
func (*MockPathMockRecorder) Name ¶ added in v0.1.9
func (mr *MockPathMockRecorder) Name() *gomock.Call
Name indicates an expected call of Name
func (*MockPathMockRecorder) Open ¶
func (mr *MockPathMockRecorder) Open() *gomock.Call
Open indicates an expected call of Open
func (*MockPathMockRecorder) Parent ¶
func (mr *MockPathMockRecorder) Parent() *gomock.Call
Parent indicates an expected call of Parent
func (*MockPathMockRecorder) Parts ¶
func (mr *MockPathMockRecorder) Parts() *gomock.Call
Parts indicates an expected call of Parts
func (*MockPathMockRecorder) RmDir ¶
func (mr *MockPathMockRecorder) RmDir() *gomock.Call
RmDir indicates an expected call of RmDir
func (*MockPathMockRecorder) Set ¶ added in v0.1.6
func (mr *MockPathMockRecorder) Set(value interface{}) *gomock.Call
Set indicates an expected call of Set
func (*MockPathMockRecorder) Stem ¶ added in v0.1.9
func (mr *MockPathMockRecorder) Stem() *gomock.Call
Stem indicates an expected call of Stem
func (*MockPathMockRecorder) String ¶
func (mr *MockPathMockRecorder) String() *gomock.Call
String indicates an expected call of String
func (*MockPathMockRecorder) Suffix ¶ added in v0.1.9
func (mr *MockPathMockRecorder) Suffix() *gomock.Call
Suffix indicates an expected call of Suffix
func (*MockPathMockRecorder) Touch ¶
func (mr *MockPathMockRecorder) Touch() *gomock.Call
Touch indicates an expected call of Touch
func (*MockPathMockRecorder) Unlink ¶
func (mr *MockPathMockRecorder) Unlink() *gomock.Call
Unlink indicates an expected call of Unlink
func (*MockPathMockRecorder) WithSuffix ¶ added in v0.1.9
func (mr *MockPathMockRecorder) WithSuffix(value interface{}) *gomock.Call
WithSuffix indicates an expected call of WithSuffix
type Path ¶
type Path interface { // Parts get the list of path components Parts() []string // Absolute Returns an absolute representation of path. Absolute() (Path, error) // Cwd Return a new path pointing to the current working directory. Cwd() (Path, error) // Parent Return a new path for current path parent. Parent() (Path, error) // Touch Create creates the named file with mode 0666 (before umask), regardless of whether it exists. Touch() error // RmDir Remove this directory. RmDir() error // Unlink Remove this file or link. Unlink() error // MkDir Create a new directory at this given path. MkDir(mode os.FileMode, parents bool) (err error) // Open Reads the file named by filename and returns the contents. Open() ([]byte, error) // Chmod changes the mode of the named file to mode. Chmod(mode os.FileMode) error // JoinPath Returns a new path, Combine current path with one or several arguments JoinPath(elem ...string) Path // Exists reports current path parent exists. Exists() bool // IsAbsolute reports whether the path is absolute. IsAbsolute() bool // IsFile reports whether this path is a regular file. IsFile() bool // IsDir reports whether this path is a directory. IsDir() bool // IsLink returns if a path is a symlink. // The second return value is the resolved path of the symlink, or the original path // The error and bool indicate which value you get back, but the path is usable in either case // It CAN point to a file that no longer exists (broken link) so do your checks. IsLink() (bool, Path, error) // ExpandUser returns a copy of this path with ~ expanded ExpandUser() Path // String Get the string version of the path String() string // Set explicitly replaces the current value Set(value string) // Name returns the final segment of the path, which is the name of the file or directory Name() string // Stem returns the name without the suffix Stem() string // Suffix returns the suffix of the name, including the dot Suffix() string // WithSuffix returns a new path with the suffix replaced WithSuffix(value string) Path // IsRelativeTo returns whether a path is relative to another path IsRelativeTo(value Path) bool }
Path to a directory or file
type PathImpl ¶
PathImpl is the real implementation of interface Path over os/filepath and fs and so on
func (PathImpl) ExpandUser ¶
ExpandUser returns a copy of this path with ~ expanded
func (PathImpl) IsAbsolute ¶
IsAbsolute reports whether the path is absolute.
func (PathImpl) IsLink ¶ added in v0.1.13
IsLink returns if a path is a symlink. The second return value is the resolved path of the symlink, or the original path If the link is bad, you do NOT get an error, but the target path will be empty The error and bool indicate which value you get back, but the path is usable in either case
func (PathImpl) IsRelativeTo ¶ added in v0.1.10
IsRelativeTo returns whether a path is relative to another path
func (PathImpl) JoinPath ¶
JoinPath Returns a new path, Combine current path with one or several arguments
func (PathImpl) Name ¶ added in v0.1.9
Name returns the final segment of the path, which is the name of the file or directory
func (PathImpl) Touch ¶
Touch Create creates the named file with mode 0666 (before umask), regardless of whether it exists.
func (PathImpl) WithSuffix ¶ added in v0.1.9
WithSuffix returns a new path with the suffix replaced