Documentation ¶
Overview ¶
Package router allows you to mount Billy.Filesystems over another.
Index ¶
- type Router
- func (r *Router) Capabilities() billy.Capability
- func (r *Router) Chmod(p string, mode os.FileMode) error
- func (r *Router) Chown(p string, uid, gid int) error
- func (r *Router) Chroot(p string) (billy.Filesystem, error)
- func (r *Router) Chtimes(p string, atime, mtime time.Time) error
- func (r *Router) Create(p string) (billy.File, error)
- func (r *Router) Join(elem ...string) string
- func (r *Router) Lchown(p string, uid, gid int) error
- func (r *Router) Lstat(p string) (os.FileInfo, error)
- func (r *Router) MkdirAll(p string, perm os.FileMode) error
- func (r *Router) Mount(p string, fs billy.Basic)
- func (r *Router) Open(p string) (billy.File, error)
- func (r *Router) OpenFile(p string, flag int, mode os.FileMode) (billy.File, error)
- func (r *Router) ReadDir(p string) ([]os.FileInfo, error)
- func (r *Router) Readlink(p string) (string, error)
- func (r *Router) Remove(p string) error
- func (r *Router) Rename(from, to string) error
- func (r *Router) Root() string
- func (r *Router) SetCrossFilesystemRenameCallback(f func(fromFS, toFS billy.Filesystem, fromPath, toPath string) error)
- func (r *Router) Stat(p string) (os.FileInfo, error)
- func (r *Router) Symlink(target, link string) error
- func (r *Router) TempFile(dir, prefix string) (billy.File, error)
- func (r *Router) Umount(p string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func New ¶
func New(root billy.Basic) *Router
New creates a new billy.Filesystem that forwards all calls to the given root filesystem. After this you can call Mount() to overlay other filesystems over it.
func (*Router) Capabilities ¶
func (r *Router) Capabilities() billy.Capability
func (*Router) Mount ¶
Mount the given filesystem at the given path. Any calls to inside that path will be sent to the given filesystem. Any intermediate directories up to your mountpoint are implicitly created.
func (*Router) SetCrossFilesystemRenameCallback ¶
func (r *Router) SetCrossFilesystemRenameCallback(f func(fromFS, toFS billy.Filesystem, fromPath, toPath string) error)
SetCrossFilesystemRenameCallback is called to provide an implementation of cross filesystem renaming. Renaming cross filesystem is impossible to implement correctly (atomicity can't be done through the billy.Filesystem API). However, many people will be okay with an imperfect implementation (like just copy+remove), so you can specify your own implementation. The default callback just returns an error.