package billy

Import Path
	github.com/go-git/go-billy/v5 (on go.dev)

Dependency Relation
	imports 4 packages, and imported by 11 packages

Involved Source Files fs.go
Package-Level Type Names (total 10, all are exported)
/* sort exporteds by: | */
Basic abstract the basic operations in a storage-agnostic interface as an extension to the Basic interface. Create creates the named file with mode 0666 (before umask), truncating it if it already exists. If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR. Join joins any number of path elements into a single path, adding a Separator if necessary. Join calls filepath.Clean on the result; in particular, all empty strings are ignored. On Windows, the result is a UNC path if and only if the first path element is a UNC path. Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. OpenFile is the generalized open call; most users will use Open or Create instead. It opens the named file with specified flag (O_RDONLY etc.) and perm, (0666 etc.) if applicable. If successful, methods on the returned File can be used for I/O. Remove removes the named file or directory. Rename renames (moves) oldpath to newpath. If newpath already exists and is not a directory, Rename replaces it. OS-specific restrictions may apply when oldpath and newpath are in different directories. Stat returns a FileInfo describing the named file. Filesystem (interface) *github.com/go-git/go-billy/v5/helper/chroot.ChrootHelper github.com/go-git/go-billy/v5/helper/polyfill.Polyfill *github.com/go-git/go-billy/v5/osfs.OS func github.com/go-git/go-billy/v5/helper/chroot.(*ChrootHelper).Underlying() Basic func github.com/go-git/go-billy/v5/helper/polyfill.(*Polyfill).Underlying() Basic func Capabilities(fs Basic) Capability func CapabilityCheck(fs Basic, capabilities Capability) bool func github.com/go-git/go-billy/v5/helper/chroot.New(fs Basic, base string) Filesystem func github.com/go-git/go-billy/v5/helper/polyfill.New(fs Basic) Filesystem func github.com/go-git/go-billy/v5/util.RemoveAll(fs Basic, path string) error func github.com/go-git/go-billy/v5/util.TempFile(fs Basic, dir, prefix string) (f File, err error) func github.com/go-git/go-billy/v5/util.WriteFile(fs Basic, filename string, data []byte, perm os.FileMode) error
Capability holds the supported features of a billy filesystem. This does not mean that the capability has to be supported by the underlying storage. For example, a billy filesystem may support WriteCapability but the storage be mounted in read only mode. func Capabilities(fs Basic) Capability func Capable.Capabilities() Capability func github.com/go-git/go-billy/v5/helper/chroot.(*ChrootHelper).Capabilities() Capability func github.com/go-git/go-billy/v5/helper/polyfill.(*Polyfill).Capabilities() Capability func github.com/go-git/go-billy/v5/osfs.(*OS).Capabilities() Capability func CapabilityCheck(fs Basic, capabilities Capability) bool const AllCapabilities const DefaultCapabilities const LockCapability const ReadAndWriteCapability const ReadCapability const SeekCapability const TruncateCapability const WriteCapability
Capable interface can return the available features of a filesystem. Capabilities returns the capabilities of a filesystem in bit flags. *github.com/go-git/go-billy/v5/helper/chroot.ChrootHelper *github.com/go-git/go-billy/v5/helper/polyfill.Polyfill *github.com/go-git/go-billy/v5/osfs.OS
Change abstract the FileInfo change related operations in a storage-agnostic interface as an extension to the Basic interface Chmod changes the mode of the named file to mode. If the file is a symbolic link, it changes the mode of the link's target. Chown changes the numeric uid and gid of the named file. If the file is a symbolic link, it changes the uid and gid of the link's target. Chtimes changes the access and modification times of the named file, similar to the Unix utime() or utimes() functions. The underlying filesystem may truncate or round the values to a less precise time unit. Lchown changes the numeric uid and gid of the named file. If the file is a symbolic link, it changes the uid and gid of the link itself.
Chroot abstract the chroot related operations in a storage-agnostic interface as an extension to the Basic interface. Chroot returns a new filesystem from the same type where the new root is the given path. Files outside of the designated directory tree cannot be accessed. Root returns the root path of the filesystem. Filesystem (interface) *github.com/go-git/go-billy/v5/helper/chroot.ChrootHelper *github.com/go-git/go-billy/v5/helper/polyfill.Polyfill
Dir abstract the dir related operations in a storage-agnostic interface as an extension to the Basic interface. MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. The permission bits perm are used for all directories that MkdirAll creates. If path is/ already a directory, MkdirAll does nothing and returns nil. ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename. Filesystem (interface) *github.com/go-git/go-billy/v5/helper/chroot.ChrootHelper *github.com/go-git/go-billy/v5/helper/polyfill.Polyfill *github.com/go-git/go-billy/v5/osfs.OS func github.com/go-git/go-billy/v5/util.TempDir(fs Dir, dir, prefix string) (name string, err error)
File represent a file, being a subset of the os.File ( T) Close() error Lock locks the file like e.g. flock. It protects against access from other processes. Name returns the name of the file as presented to Open. ( T) Read(p []byte) (n int, err error) ( T) ReadAt(p []byte, off int64) (n int, err error) ( T) Seek(offset int64, whence int) (int64, error) Truncate the file. Unlock unlocks the file. ( T) Write(p []byte) (n int, err error) T : github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband.Progress T : github.com/jbenet/go-context/io.Reader T : github.com/jbenet/go-context/io.Writer T : io.Closer T : io.ReadCloser T : io.Reader T : io.ReaderAt T : io.ReadSeekCloser T : io.ReadSeeker T : io.ReadWriteCloser T : io.ReadWriter T : io.ReadWriteSeeker T : io.Seeker T : io.WriteCloser T : io.Writer T : io.WriteSeeker T : mime/multipart.File func Basic.Create(filename string) (File, error) func Basic.Open(filename string) (File, error) func Basic.OpenFile(filename string, flag int, perm os.FileMode) (File, error) func Filesystem.Create(filename string) (File, error) func Filesystem.Open(filename string) (File, error) func Filesystem.OpenFile(filename string, flag int, perm os.FileMode) (File, error) func Filesystem.TempFile(dir, prefix string) (File, error) func TempFile.TempFile(dir, prefix string) (File, error) func github.com/go-git/go-billy/v5/helper/chroot.(*ChrootHelper).Create(filename string) (File, error) func github.com/go-git/go-billy/v5/helper/chroot.(*ChrootHelper).Open(filename string) (File, error) func github.com/go-git/go-billy/v5/helper/chroot.(*ChrootHelper).OpenFile(filename string, flag int, mode os.FileMode) (File, error) func github.com/go-git/go-billy/v5/helper/chroot.(*ChrootHelper).TempFile(dir, prefix string) (File, error) func github.com/go-git/go-billy/v5/helper/polyfill.(*Polyfill).TempFile(dir, prefix string) (File, error) func github.com/go-git/go-billy/v5/osfs.(*OS).Create(filename string) (File, error) func github.com/go-git/go-billy/v5/osfs.(*OS).Open(filename string) (File, error) func github.com/go-git/go-billy/v5/osfs.(*OS).OpenFile(filename string, flag int, perm os.FileMode) (File, error) func github.com/go-git/go-billy/v5/osfs.(*OS).TempFile(dir, prefix string) (File, error) func github.com/go-git/go-billy/v5/util.TempFile(fs Basic, dir, prefix string) (f File, err error) func github.com/go-git/go-git/v5/storage/filesystem/dotgit.(*DotGit).Config() (File, error) func github.com/go-git/go-git/v5/storage/filesystem/dotgit.(*DotGit).ConfigWriter() (File, error) func github.com/go-git/go-git/v5/storage/filesystem/dotgit.(*DotGit).Index() (File, error) func github.com/go-git/go-git/v5/storage/filesystem/dotgit.(*DotGit).IndexWriter() (File, error) func github.com/go-git/go-git/v5/storage/filesystem/dotgit.(*DotGit).Object(h plumbing.Hash) (File, error) func github.com/go-git/go-git/v5/storage/filesystem/dotgit.(*DotGit).ObjectPack(hash plumbing.Hash) (File, error) func github.com/go-git/go-git/v5/storage/filesystem/dotgit.(*DotGit).ObjectPackIdx(hash plumbing.Hash) (File, error) func github.com/go-git/go-git/v5/storage/filesystem/dotgit.(*DotGit).Shallow() (File, error) func github.com/go-git/go-git/v5/storage/filesystem/dotgit.(*DotGit).ShallowWriter() (File, error) func github.com/go-git/go-git/v5/plumbing/format/packfile.NewPackfile(index idxfile.Index, fs Filesystem, file File) *packfile.Packfile func github.com/go-git/go-git/v5/plumbing/format/packfile.NewPackfileWithCache(index idxfile.Index, fs Filesystem, file File, cache cache.Object) *packfile.Packfile func github.com/go-git/go-git/v5/storage/filesystem.NewPackfileIter(fs Filesystem, f File, idxFile File, t plumbing.ObjectType, keepPack bool) (storer.EncodedObjectIter, error) func github.com/go-git/go-git/v5/storage/filesystem.NewPackfileIter(fs Filesystem, f File, idxFile File, t plumbing.ObjectType, keepPack bool) (storer.EncodedObjectIter, error)
Filesystem abstract the operations in a storage-agnostic interface. Each method implementation mimics the behavior of the equivalent functions at the os package from the standard library. Chroot returns a new filesystem from the same type where the new root is the given path. Files outside of the designated directory tree cannot be accessed. Create creates the named file with mode 0666 (before umask), truncating it if it already exists. If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR. Join joins any number of path elements into a single path, adding a Separator if necessary. Join calls filepath.Clean on the result; in particular, all empty strings are ignored. On Windows, the result is a UNC path if and only if the first path element is a UNC path. Lstat returns a FileInfo describing the named file. If the file is a symbolic link, the returned FileInfo describes the symbolic link. Lstat makes no attempt to follow the link. MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. The permission bits perm are used for all directories that MkdirAll creates. If path is/ already a directory, MkdirAll does nothing and returns nil. Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. OpenFile is the generalized open call; most users will use Open or Create instead. It opens the named file with specified flag (O_RDONLY etc.) and perm, (0666 etc.) if applicable. If successful, methods on the returned File can be used for I/O. ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename. Readlink returns the target path of link. Remove removes the named file or directory. Rename renames (moves) oldpath to newpath. If newpath already exists and is not a directory, Rename replaces it. OS-specific restrictions may apply when oldpath and newpath are in different directories. Root returns the root path of the filesystem. Stat returns a FileInfo describing the named file. Symlink creates a symbolic-link from link to target. target may be an absolute or relative path, and need not refer to an existing node. Parent directories of link are created as necessary. TempFile creates a new temporary file in the directory dir with a name beginning with prefix, opens the file for reading and writing, and returns the resulting *os.File. If dir is the empty string, TempFile uses the default directory for temporary files (see os.TempDir). Multiple programs calling TempFile simultaneously will not choose the same file. The caller can use f.Name() to find the pathname of the file. It is the caller's responsibility to remove the file when no longer needed. *github.com/go-git/go-billy/v5/helper/chroot.ChrootHelper *github.com/go-git/go-billy/v5/helper/polyfill.Polyfill T : Basic T : Chroot T : Dir T : Symlink T : TempFile func Chroot.Chroot(path string) (Filesystem, error) func Filesystem.Chroot(path string) (Filesystem, error) func github.com/go-git/go-billy/v5/helper/chroot.New(fs Basic, base string) Filesystem func github.com/go-git/go-billy/v5/helper/chroot.(*ChrootHelper).Chroot(path string) (Filesystem, error) func github.com/go-git/go-billy/v5/helper/polyfill.New(fs Basic) Filesystem func github.com/go-git/go-billy/v5/helper/polyfill.(*Polyfill).Chroot(path string) (Filesystem, error) func github.com/go-git/go-billy/v5/osfs.New(baseDir string) Filesystem func github.com/go-git/go-git/v5/storage/filesystem.(*Storage).Filesystem() Filesystem func github.com/go-git/go-git/v5/storage/filesystem/dotgit.(*DotGit).Fs() Filesystem func github.com/go-git/go-git/v5/storage/filesystem/dotgit.(*DotGit).Module(name string) (Filesystem, error) func github.com/go-git/go-billy/v5/util.Glob(fs Filesystem, pattern string) (matches []string, err error) func github.com/go-git/go-git/v5.Clone(s storage.Storer, worktree Filesystem, o *git.CloneOptions) (*git.Repository, error) func github.com/go-git/go-git/v5.CloneContext(ctx context.Context, s storage.Storer, worktree Filesystem, o *git.CloneOptions) (*git.Repository, error) func github.com/go-git/go-git/v5.Init(s storage.Storer, worktree Filesystem) (*git.Repository, error) func github.com/go-git/go-git/v5.Open(s storage.Storer, worktree Filesystem) (*git.Repository, error) func github.com/go-git/go-git/v5/plumbing/format/gitignore.LoadGlobalPatterns(fs Filesystem) (ps []gitignore.Pattern, err error) func github.com/go-git/go-git/v5/plumbing/format/gitignore.LoadSystemPatterns(fs Filesystem) (ps []gitignore.Pattern, err error) func github.com/go-git/go-git/v5/plumbing/format/gitignore.ReadPatterns(fs Filesystem, path []string) (ps []gitignore.Pattern, err error) func github.com/go-git/go-git/v5/plumbing/format/packfile.NewFSObject(hash plumbing.Hash, finalType plumbing.ObjectType, offset int64, contentSize int64, index idxfile.Index, fs Filesystem, path string, cache cache.Object) *packfile.FSObject func github.com/go-git/go-git/v5/plumbing/format/packfile.NewPackfile(index idxfile.Index, fs Filesystem, file File) *packfile.Packfile func github.com/go-git/go-git/v5/plumbing/format/packfile.NewPackfileWithCache(index idxfile.Index, fs Filesystem, file File, cache cache.Object) *packfile.Packfile func github.com/go-git/go-git/v5/plumbing/transport/server.NewFilesystemLoader(base Filesystem) server.Loader func github.com/go-git/go-git/v5/storage/filesystem.NewPackfileIter(fs Filesystem, f File, idxFile File, t plumbing.ObjectType, keepPack bool) (storer.EncodedObjectIter, error) func github.com/go-git/go-git/v5/storage/filesystem.NewStorage(fs Filesystem, cache cache.Object) *filesystem.Storage func github.com/go-git/go-git/v5/storage/filesystem.NewStorageWithOptions(fs Filesystem, cache cache.Object, ops filesystem.Options) *filesystem.Storage func github.com/go-git/go-git/v5/storage/filesystem/dotgit.New(fs Filesystem) *dotgit.DotGit func github.com/go-git/go-git/v5/storage/filesystem/dotgit.NewWithOptions(fs Filesystem, o dotgit.Options) *dotgit.DotGit func github.com/go-git/go-git/v5/utils/merkletrie/filesystem.NewRootNode(fs Filesystem, submodules map[string]plumbing.Hash) noder.Noder
TempFile creates a new temporary file in the directory dir with a name beginning with prefix, opens the file for reading and writing, and returns the resulting *os.File. If dir is the empty string, TempFile uses the default directory for temporary files (see os.TempDir). Multiple programs calling TempFile simultaneously will not choose the same file. The caller can use f.Name() to find the pathname of the file. It is the caller's responsibility to remove the file when no longer needed. Filesystem (interface) *github.com/go-git/go-billy/v5/helper/chroot.ChrootHelper *github.com/go-git/go-billy/v5/helper/polyfill.Polyfill *github.com/go-git/go-billy/v5/osfs.OS
Package-Level Functions (total 2, both are exported)
Capabilities returns the features supported by a filesystem. If the FS does not implement Capable interface it returns all features.
CapabilityCheck tests the filesystem for the provided capabilities and returns true in case it supports all of them.
Package-Level Variables (total 3, all are exported)
Package-Level Constants (total 8, all are exported)
AllCapabilities lists all capable features.
DefaultCapabilities lists all capable features supported by filesystems without Capability interface. This list should not be changed until a major version is released.
LockCapability is the ability to lock a file.
ReadAndWriteCapability is the ability to open a file in read and write mode.
ReadCapability means that the fs is readable.
SeekCapability means it is able to move position inside the file.
TruncateCapability means that a file can be truncated.
WriteCapability means that the fs is writable.